/* Google Fonts Integration: Prompt for Thai, Montserrat for English Headings */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand Colors */
  --brand-red: #f50000;
  --brand-red-hover: #d10000;
  --brand-orange: #fa8c00;
  --brand-orange-hover: #e07b00;
  --brand-yellow-light: #fffcf8;
  
  /* Status Colors */
  --status-todo: #4a5568;
  --status-todo-bg: #edf2f7;
  --status-todo-border: #cbd5e0;
  
  --status-progress: #dd6b20;
  --status-progress-bg: #feebc8;
  --status-progress-border: #fbd38d;
  
  --status-review: #805ad5;
  --status-review-bg: #ebf4ff;
  --status-review-border: #c3dafe;
  
  --status-done: #38a169;
  --status-done-bg: #c6f6d5;
  --status-done-border: #9ae6b4;

  /* Priority Colors */
  --priority-high: #e53e3e;
  --priority-high-bg: #fed7d7;
  --priority-medium: #dd6b20;
  --priority-medium-bg: #feebc8;
  --priority-low: #3182ce;
  --priority-low-bg: #ebf8ff;

  /* Tag Colors (Upgraded for all 17 marketing work types) */
  --tag-graphic: #fed7d7;
  --tag-graphic-text: #9b2c2c;
  --tag-content: #feebc8;
  --tag-content-text: #9c4221;
  --tag-social-media: #ebf8ff;
  --tag-social-media-text: #2b6cb0;
  --tag-video-motion: #e9d8fd;
  --tag-video-motion-text: #553c9a;
  --tag-campaign: #e6fffa;
  --tag-campaign-text: #234e52;
  --tag-ads: #fed7d7;
  --tag-ads-text: #9b2c2c;
  --tag-line-oa: #e2f9e9;
  --tag-line-oa-text: #1a7f37;
  --tag-website: #e6fffa;
  --tag-website-text: #234e52;
  --tag-posm: #edf2f7;
  --tag-posm-text: #4a5568;
  --tag-menu: #edf2f7;
  --tag-menu-text: #4a5568;
  --tag-event: #ebf8ff;
  --tag-event-text: #2b6cb0;
  --tag-branch-support: #edf2f7;
  --tag-branch-support-text: #4a5568;
  --tag-kol: #e9d8fd;
  --tag-kol-text: #553c9a;
  --tag-retouch: #fed7d7;
  --tag-retouch-text: #9b2c2c;
  --tag-report: #e2f9e9;
  --tag-report-text: #1a7f37;
  --tag-coordinate: #edf2f7;
  --tag-coordinate-text: #4a5568;
  --tag-other: #edf2f7;
  --tag-other-text: #4a5568;

  /* Promo Tracker Specific Card Colors */
  --promo-live-bg: #c6f6d5;
  --promo-live-text: #1a7f37;
  --promo-scheduled-bg: #fef0d5;
  --promo-scheduled-text: #b7791f;
  --promo-ending-bg: #fed7d7;
  --promo-ending-text: #c53030;
  --promo-ended-bg: #f2ede4;
  --promo-ended-text: #4a5568;

  /* Neutral UI Colors */
  --bg-main: #f7f9fa;
  --bg-card: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --text-light: #a0aec0;
  --border-light: #e2e8f0;
  
  /* UI Layout Tokens */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-brand: 0 4px 14px 0 rgba(245, 0, 0, 0.2);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Prompt', 'Montserrat', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Page Header styling */
header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-img {
  height: 48px;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.logo-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-sub {
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: -4px;
}

/* Navigation Buttons and Swicher */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.role-switcher-container {
  display: flex;
  align-items: center;
  background: #edf2f7;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  position: relative;
}

.role-btn {
  background: transparent;
  border: none;
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.role-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.role-btn:hover:not(.active) {
  color: var(--brand-red);
}

.user-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-selector-wrapper span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.user-dropdown {
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  padding: 0.5rem 2rem 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 10px) center;
  min-width: 160px;
  outline: none;
  transition: var(--transition-fast);
}

.user-dropdown:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(245, 0, 0, 0.1);
}

/* Main Container Layout */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Section Common Styles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--brand-red);
  border-radius: 2px;
}

.section-actions-group {
  display: flex;
  gap: 0.5rem;
}

/* Manager View: Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.total::after { background: var(--brand-red); }
.stat-card.todo::after { background: var(--status-todo); }
.stat-card.progress::after { background: var(--status-progress); }
.stat-card.review::after { background: var(--status-review); }
.stat-card.done::after { background: var(--status-done); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-info h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.25rem;
  line-height: 1;
}

.stat-icon {
  font-size: 2.5rem;
  opacity: 0.2;
}

/* Manager View: Workload and Grid Container */
.manager-content-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Team Workload Widget */
.workload-panel {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.workload-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
}

.workload-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.workload-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.workload-member-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.workload-name {
  font-weight: 600;
}

.workload-badge-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.workload-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.workload-progress-bar-bg {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.workload-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-orange) 0%, var(--brand-red) 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

/* Manager View: Task Table Panel */
.table-panel {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.table-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-input-wrapper {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-family: 'Prompt', sans-serif;
  outline: none;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(245, 0, 0, 0.1);
}

.search-icon-svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  fill: var(--text-light);
  width: 16px;
  height: 16px;
}

.filter-select {
  font-family: 'Prompt', sans-serif;
  padding: 0.5rem 2rem 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  cursor: pointer;
  outline: none;
  font-size: 0.9rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 10px) center;
  appearance: none;
  -webkit-appearance: none;
  min-width: 140px;
}

.filter-select:focus {
  border-color: var(--brand-red);
}

/* Master Task Table Styling */
.table-wrapper {
  overflow-x: auto;
}

table.task-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

table.task-table th, table.task-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
}

table.task-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-main);
}

table.task-table tbody tr:hover {
  background: rgba(245, 0, 0, 0.01);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Kanban Board Layout */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: start;
  min-height: 600px;
}

.kanban-column {
  background: #edf2f7;
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 800px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.02);
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
}

.kanban-column-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kanban-column.todo .kanban-column-dot { background: var(--status-todo); }
.kanban-column.progress .kanban-column-dot { background: var(--status-progress); }
.kanban-column.review .kanban-column-dot { background: var(--status-review); }
.kanban-column.done .kanban-column-dot { background: var(--status-done); }

.kanban-column-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.kanban-card-count {
  background: var(--bg-card);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 12px;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  flex-grow: 1;
  min-height: 200px;
  padding: 0.2rem;
}

.kanban-cards-container.drag-over {
  background: rgba(250, 140, 0, 0.07);
  outline: 2px dashed var(--brand-orange);
  border-radius: var(--radius-md);
}

/* Kanban Cards UI */
.task-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  cursor: grab;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.task-card:active {
  cursor: grabbing;
}

.task-card.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(245,0,0,0.1);
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.task-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.task-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.task-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Badge Styles */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Priority Badges */
.badge.priority-high { background-color: var(--priority-high-bg); color: var(--priority-high); }
.badge.priority-medium { background-color: var(--priority-medium-bg); color: var(--priority-medium); }
.badge.priority-low { background-color: var(--priority-low-bg); color: var(--priority-low); }

/* Task Tag Badges */
.badge.tag-graphic { background-color: var(--tag-graphic); color: var(--tag-graphic-text); }
.badge.tag-content { background-color: var(--tag-content); color: var(--tag-content-text); }
.badge.tag-social-media { background-color: var(--tag-social-media); color: var(--tag-social-media-text); }
.badge.tag-video-motion { background-color: var(--tag-video-motion); color: var(--tag-video-motion-text); }
.badge.tag-campaign { background-color: var(--tag-campaign); color: var(--tag-campaign-text); }
.badge.tag-ads { background-color: var(--tag-ads); color: var(--tag-ads-text); }
.badge.tag-line-oa { background-color: var(--tag-line-oa); color: var(--tag-line-oa-text); }
.badge.tag-website { background-color: var(--tag-website); color: var(--tag-website-text); }
.badge.tag-posm { background-color: var(--tag-posm); color: var(--tag-posm-text); }
.badge.tag-menu { background-color: var(--tag-menu); color: var(--tag-menu-text); }
.badge.tag-event { background-color: var(--tag-event); color: var(--tag-event-text); }
.badge.tag-branch-support { background-color: var(--tag-branch-support); color: var(--tag-branch-support-text); }
.badge.tag-kol { background-color: var(--tag-kol); color: var(--tag-kol-text); }
.badge.tag-retouch { background-color: var(--tag-retouch); color: var(--tag-retouch-text); }
.badge.tag-report { background-color: var(--tag-report); color: var(--tag-report-text); }
.badge.tag-coordinate { background-color: var(--tag-coordinate); color: var(--tag-coordinate-text); }
.badge.tag-other { background-color: var(--tag-other); color: var(--tag-other-text); }

/* Status Badges in List View */
.badge.status-todo { background-color: var(--status-todo-bg); color: var(--status-todo); border: 1px solid var(--status-todo-border); }
.badge.status-progress { background-color: var(--status-progress-bg); color: var(--status-progress); border: 1px solid var(--status-progress-border); }
.badge.status-review { background-color: var(--status-review-bg); color: var(--status-review); border: 1px solid var(--status-review-border); }
.badge.status-done { background-color: var(--status-done-bg); color: var(--status-done); border: 1px solid var(--status-done-border); }

/* Card Footer with Meta details */
.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-card-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-card-date.overdue {
  color: var(--priority-high);
  font-weight: 600;
}

.task-card-actions {
  display: flex;
  gap: 0.25rem;
}

/* Button Component Styles */
.btn {
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--brand-red);
  color: white;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  background: var(--brand-red-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #edf2f7;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-main);
}

.btn-icon.edit:hover {
  color: var(--brand-orange);
  background: var(--status-progress-bg);
}

.btn-icon.delete:hover {
  color: var(--brand-red);
  background: #fed7d7;
}

/* User Avatar Bubble */
.avatar-bubble {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-orange);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* Dialog/Modal Styling */
dialog.task-modal {
  margin: auto;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  width: 90%;
  max-width: 550px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  outline: none;
}

dialog.task-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

/* Modal Internal Structure */
.modal-header {
  background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-orange) 100%);
  color: white;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-header .close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: var(--transition-fast);
}

.modal-header .close-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  outline: none;
  background-color: var(--bg-card);
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(245, 0, 0, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-main);
}

.checkbox-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  background: var(--bg-main);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-item input {
  cursor: pointer;
}

/* ================= PROMO TRACKER REDESIGN STYLES ================= */

/* Stats Grid Row matching the screenshot */
.promo-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.promo-stat-card {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast);
}

.promo-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.promo-stat-card.live-now { background: var(--promo-live-bg); color: var(--promo-live-text); border: 1px solid #a3e635; }
.promo-stat-card.scheduled { background: var(--promo-scheduled-bg); color: var(--promo-scheduled-text); border: 1px solid #fbd38d; }
.promo-stat-card.ending-soon { background: var(--promo-ending-bg); color: var(--promo-ending-text); border: 1px solid #feb2b2; }
.promo-stat-card.ended { background: var(--promo-ended-bg); color: var(--promo-ended-text); border: 1px solid #e2e8f0; }

.promo-stat-card-header {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); opacity: 0.6; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.9); opacity: 1; }
}

.promo-stat-card-value {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.1;
  font-family: 'Montserrat', sans-serif;
}

.promo-stat-card-sub {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.25rem;
  opacity: 0.95;
}

/* Promo Table Panel container styling */
.promo-table-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
}

.promo-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.promo-pills-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.promo-pill-btn {
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.promo-pill-btn:hover {
  background: var(--bg-main);
  color: var(--text-main);
}

.promo-pill-btn.active {
  background: #0f172a; /* Dark charcoal/black active filter pill */
  color: white;
  border-color: #0f172a;
  font-weight: 600;
}

/* Custom table rules matching the screenshot */
table.promo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

table.promo-table th, table.promo-table td {
  padding: 1.1rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

table.promo-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--text-light);
}

/* Highlight Scheduled rows in light gold/cream shade */
table.promo-table tbody tr.scheduled-row {
  background-color: #fbf8eb;
}

table.promo-table tbody tr:hover:not(.scheduled-row) {
  background: rgba(0, 0, 0, 0.005);
}

/* Channel Badges list style */
.promo-channel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Specific Channel Badges styles */
.ch-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
}

.ch-badge.fb { background-color: #ebf8ff; color: #2b6cb0; }
.ch-badge.ig { background-color: #fff5f5; color: #e53e3e; }
.ch-badge.tt { background-color: #000000; color: #ffffff; }
.ch-badge.ln { background-color: #e6fffa; color: #234e52; }
.ch-badge.lm { background-color: #e2f9e9; color: #1a7f37; }
.ch-badge.pro-branch { background-color: #f7fafc; color: #4a5568; font-family: 'Prompt', sans-serif; font-weight: 600; }
.ch-badge.web { background-color: #feebc8; color: #c05621; } /* Fallback just in case */

/* Promo status pill cell styling */
.promo-status-cell-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid transparent;
}

.promo-status-cell-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.promo-status-cell-badge.active { background: #e2f9e9; color: #1a7f37; }
.promo-status-cell-badge.active::before { background-color: #1a7f37; }

.promo-status-cell-badge.ending { background: #fce5e3; color: #c53030; }
.promo-status-cell-badge.ending::before { background-color: #c53030; }

.promo-status-cell-badge.upcoming { background: #fdf3e2; color: #b7791f; }
.promo-status-cell-badge.upcoming::before { background-color: #b7791f; }

.promo-status-cell-badge.ended { background: #f2ede4; color: #4a5568; }
.promo-status-cell-badge.ended::before { background-color: #4a5568; }

/* Progress bar matching the screenshot layout */
.promo-table-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 140px;
}

.promo-table-progress-track {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.promo-table-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--text-light);
}

.promo-table-progress-fill.active { background: #10b981; }
.promo-table-progress-fill.ending { background: #f59e0b; }
.promo-table-progress-fill.ended { background: #10b981; }

.promo-table-progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Responsiveness overrides for the custom table */
@media (max-width: 1024px) {
  .promo-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .promo-stats-row {
    grid-template-columns: 1fr;
  }
  .promo-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .promo-pills-filter {
    justify-content: space-between;
  }
  .promo-pill-btn {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.25rem;
  }
}

/* ================= LOGIN PANEL STYLING ================= */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(245, 0, 0, 0.05) 0%, #0f172a 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  transition: opacity 0.3s ease;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-light);
  width: 90%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-red) 0%, var(--brand-orange) 100%);
}

.login-logo {
  height: 60px;
  margin-bottom: 1.5rem;
  object-fit: contain;
}

.login-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.login-card form {
  width: 100%;
  text-align: left;
}

.login-error-msg {
  color: var(--priority-high);
  background-color: var(--priority-high-bg);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  border: 1px solid #feb2b2;
  text-align: center;
}

