/* CSS Design System for Print Production CRM Dashboard */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Core Dark CRM Palette */
  --bg-app: #080c16;
  --bg-sidebar: #0d1223;
  --bg-card: #12182d;
  --bg-item: #19203a;
  
  --border-color: #1e293b;
  --border-card: #232f4d;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Primary Glowing Indigo Accent */
  --primary: #4f46e5;
  --primary-hover: #6366f1;
  --primary-light: rgba(79, 70, 229, 0.15);
  --primary-glow: 0 0 16px rgba(79, 70, 229, 0.25);
  
  /* Status Color Palettes */
  --status-design-text: #60a5fa;
  --status-design-bg: rgba(59, 130, 246, 0.1);
  --status-design-border: rgba(59, 130, 246, 0.3);
  --status-design-indicator: #3b82f6;
  
  --status-proofing-text: #fb923c;
  --status-proofing-bg: rgba(249, 115, 22, 0.1);
  --status-proofing-border: rgba(249, 115, 22, 0.3);
  --status-proofing-indicator: #f97316;
  
  --status-printer-text: #c084fc;
  --status-printer-bg: rgba(168, 85, 247, 0.1);
  --status-printer-border: rgba(168, 85, 247, 0.3);
  --status-printer-indicator: #a855f7;
  
  --status-completed-text: #34d399;
  --status-completed-bg: rgba(16, 185, 129, 0.1);
  --status-completed-border: rgba(16, 185, 129, 0.3);
  --status-completed-indicator: #10b981;
  
  /* CS Teams Colors */
  --team-alpha-text: #2dd4bf;
  --team-alpha-bg: rgba(45, 212, 191, 0.08);
  --team-alpha-border: rgba(45, 212, 191, 0.3);
  
  --team-bravo-text: #f472b6;
  --team-bravo-bg: rgba(244, 114, 182, 0.08);
  --team-bravo-border: rgba(244, 114, 182, 0.3);
  
  --team-charlie-text: #a78bfa;
  --team-charlie-bg: rgba(167, 139, 250, 0.08);
  --team-charlie-border: rgba(167, 139, 250, 0.3);

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
}

/* Left Sidebar Layout */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 32px 20px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding-left: 8px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--primary-glow);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.menu-item.active a {
  color: #ffffff;
  background-color: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding-left: 13px;
}

.menu-item:not(.active) a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.06);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* Main Workspace Content */
.main-content {
  margin-left: 260px;
  flex-grow: 1;
  min-height: 100vh;
  padding: 40px;
  overflow-y: auto;
  width: calc(100% - 260px);
}

/* View switching display */
.view-section {
  display: none;
  animation: sectionFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
  display: block;
}

@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 16px;
}

.workspace-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 4px;
}

.workspace-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Primary and Secondary Buttons */
.btn-primary {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  height: 38px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
  background: linear-gradient(135deg, #5a52e6 0%, #6d70f2 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: transparent;
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: #334155;
  color: #ffffff;
}

/* Metrics Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.metric-card:hover {
  border-color: var(--border-color);
  box-shadow: var(--shadow-md);
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.metric-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.metric-card:nth-child(1) .metric-icon-wrap { color: var(--primary); background-color: var(--primary-light); }
.metric-card:nth-child(2) .metric-icon-wrap { color: #60a5fa; background-color: rgba(96, 165, 250, 0.08); }
.metric-card:nth-child(3) .metric-icon-wrap { color: #c084fc; background-color: rgba(192, 132, 252, 0.08); }
.metric-card:nth-child(4) .metric-icon-wrap { color: #34d399; background-color: rgba(52, 211, 153, 0.08); }

/* Controls Section (Search + Filtering Tabs) */
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 20px;
  flex-wrap: wrap;
}

.search-container {
  position: relative;
  flex-grow: 1;
  max-width: 320px;
}

.search-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  color: #ffffff;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Tab Selector Filters */
.filter-tabs {
  display: flex;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
}

.filter-tab {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-tab:hover {
  color: #ffffff;
}

.filter-tab.active {
  color: #ffffff;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

/* Responsive Board Grid */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 28px;
  align-items: start;
}

/* Client Card (Parent) */
.client-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.client-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: var(--shadow-lg), var(--primary-glow);
}

/* Client Card Header */
.client-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 12px;
}

.client-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.client-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.client-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Badges for Teams */
.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  display: inline-flex;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  width: fit-content;
}

/* Team preset badge themes */
.badge-team-alpha { background-color: var(--team-alpha-bg); color: var(--team-alpha-text); border-color: var(--team-alpha-border); }
.badge-team-bravo { background-color: var(--team-bravo-bg); color: var(--team-bravo-text); border-color: var(--team-bravo-border); }
.badge-team-charlie { background-color: var(--team-charlie-bg); color: var(--team-charlie-text); border-color: var(--team-charlie-border); }

.badge-team-delta {
  background-color: rgba(96, 165, 250, 0.08);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}
.badge-team-echo {
  background-color: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}
.badge-team-foxtrot {
  background-color: rgba(52, 211, 153, 0.08);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}
.badge-team-unassigned {
  background-color: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

/* Delete/Edit Client Icon Triggers */
.btn-delete-client, .btn-edit-client {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.3;
}

.client-card:hover .btn-delete-client,
.client-card:hover .btn-edit-client {
  opacity: 1;
}

.btn-delete-client:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.btn-edit-client:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* Items List Section */
.items-list-container {
  flex-grow: 1;
  margin-bottom: 24px;
}

.items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.no-items-placeholder {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.01);
}

/* Nested Child Item Row */
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  transition: all 0.2s ease;
  gap: 10px;
  z-index: 1;
}

/* Lift active row so its dropdown floats over everything else */
.item-row:has(.status-menu.show) {
  z-index: 50;
}

.item-row:hover {
  border-color: #334155;
  background-color: #212948;
}

/* Colored left border based on status */
.item-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: transparent;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.item-row[data-status="Design"]::before { background-color: var(--status-design-indicator); }
.item-row[data-status="Client Proofing"]::before { background-color: var(--status-proofing-indicator); }
.item-row[data-status="Sent to Printer"]::before { background-color: var(--status-printer-indicator); }
.item-row[data-status="Completed"]::before { background-color: var(--status-completed-indicator); }

.item-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  flex-grow: 1;
  padding-left: 4px;
  word-break: break-word;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-text {
  max-width: 82px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

/* Interactive Status Pill */
.status-pill {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.status-pill::after {
  content: '▾';
  font-size: 0.6rem;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.status-pill.active-dropdown::after {
  transform: rotate(180deg);
}

.status-design {
  color: var(--status-design-text);
  background-color: var(--status-design-bg);
  border-color: var(--status-design-border);
}
.status-design:hover { background-color: rgba(59, 130, 246, 0.2); }

.status-proofing {
  color: var(--status-proofing-text);
  background-color: var(--status-proofing-bg);
  border-color: var(--status-proofing-border);
}
.status-proofing:hover { background-color: rgba(249, 115, 22, 0.2); }

.status-printer {
  color: var(--status-printer-text);
  background-color: var(--status-printer-bg);
  border-color: var(--status-printer-border);
}
.status-printer:hover { background-color: rgba(168, 85, 247, 0.2); }

.status-completed {
  color: var(--status-completed-text);
  background-color: var(--status-completed-bg);
  border-color: var(--status-completed-border);
}
.status-completed:hover { background-color: rgba(16, 185, 129, 0.2); }

.payment-unpaid {
  color: #f87171 !important;
  background-color: #451a1a !important;
  border: 1px solid #7f1d1d !important;
}
.payment-unpaid:hover {
  background-color: #581c1c !important;
}

.payment-paid {
  color: #34d399 !important;
  background-color: #064e3b !important;
  border: 1px solid #065f46 !important;
}
.payment-paid:hover {
  background-color: #047857 !important;
}

/* Custom Status Dropdown Menu */
.status-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.status-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  width: 170px;
  display: none;
  flex-direction: column;
  padding: 6px;
  animation: menuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.status-menu.show {
  display: flex;
}

.status-option {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e2e8f0 !important;
  width: 100%;
}

.status-option:hover {
  background-color: rgba(99, 102, 241, 0.2) !important;
  color: #ffffff !important;
}

.status-option.selected {
  background-color: rgba(99, 102, 241, 0.15) !important;
  color: #818cf8 !important;
}

.status-option.selected::after {
  content: '✓';
  font-size: 0.8rem;
  color: #818cf8 !important;
}

/* Delete Item trigger */
.btn-delete-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-delete-item:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Add Item Form */
.add-item-form {
  display: flex;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
}

.item-input {
  font-family: inherit;
  font-size: 0.82rem;
  color: #ffffff;
  background-color: var(--bg-item);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  flex-grow: 1;
  transition: all 0.2s ease;
}

.item-input:focus {
  border-color: var(--primary);
  background-color: #212948;
}

.btn-add-item {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--primary);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-add-item:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--primary-glow);
}

/* Progress Tracker Bar */
.card-progress-container {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-track {
  height: 5px;
  background-color: #1e293b;
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Collapsible Archived Items list inside client cards */
.archived-section {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

.btn-toggle-archived {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.btn-toggle-archived:hover {
  color: #ffffff;
}

.archived-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archived-list.hidden {
  display: none;
}

.archived-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  gap: 8px;
}

.archived-item-name {
  word-break: break-word;
  flex-grow: 1;
}

.btn-restore-item {
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.btn-restore-item:hover {
  opacity: 1;
}

.btn-archive-item {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.btn-archive-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* Directory Table Styling */
.directory-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 24px;
}

.directory-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.directory-table th {
  background-color: var(--bg-sidebar);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.directory-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-main);
}

.directory-table tr:last-child td {
  border-bottom: none;
}

.directory-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
}

.directory-table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon-action {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-icon-action:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.btn-icon-action.btn-delete:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* CS Teams Panel Styling */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 24px;
}

.team-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.team-panel:hover {
  border-color: rgba(99, 102, 241, 0.2);
}

.team-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.team-panel.team-alpha::before { background: var(--team-alpha-text); }
.team-panel.team-bravo::before { background: var(--team-bravo-text); }
.team-panel.team-charlie::before { background: var(--team-charlie-text); }
.team-panel.team-delta::before { background: #60a5fa; }
.team-panel.team-echo::before { background: #fbbf24; }
.team-panel.team-foxtrot::before { background: #34d399; }

.team-panel h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-edit-team, .btn-delete-team {
  opacity: 0.3;
  transition: all 0.2s ease;
}

.team-panel:hover .btn-edit-team,
.team-panel:hover .btn-delete-team {
  opacity: 1;
}

.btn-edit-team:hover {
  color: #ffffff;
}
.btn-delete-team:hover {
  color: #ef4444;
}

.team-panel-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.team-stat-box {
  background-color: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.team-stat-box:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.team-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.team-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.team-client-list-wrap {
  flex-grow: 1;
}

.team-client-list-wrap h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.team-client-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.team-client-item {
  font-size: 0.85rem;
  color: var(--text-main);
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-client-item span:last-child {
  color: var(--text-muted);
  font-size: 0.75rem;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 2px 8px;
  border-radius: 20px;
}

/* Empty State Dashboard */
.empty-dashboard {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-dashboard svg {
  margin-bottom: 16px;
  color: var(--text-muted);
  opacity: 0.6;
}

.empty-dashboard h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 6px;
  color: #ffffff;
}

.empty-dashboard p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 320px;
}

/* Modal Overlay Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 8, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 450px;
  max-width: 90%;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.modal-input {
  font-family: inherit;
  font-size: 0.88rem;
  color: #ffffff;
  background-color: var(--bg-item);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

.modal-input:focus {
  border-color: var(--primary);
  box-shadow: var(--primary-glow);
}

.modal-select {
  font-family: inherit;
  font-size: 0.88rem;
  color: #ffffff;
  background-color: var(--bg-item);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-select:focus {
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
  }
  
  .sidebar-logo {
    margin-bottom: 0;
    padding-left: 0;
    gap: 8px;
  }
  
  .sidebar-logo .logo-text {
    display: inline-block;
    font-size: 1.1rem;
  }
  
  .sidebar nav {
    margin-left: auto;
    margin-right: 12px;
  }
  
  .sidebar-menu {
    flex-direction: row;
    gap: 4px;
  }
  
  .menu-item a {
    padding: 8px 10px;
    gap: 6px;
    font-size: 0.8rem;
  }
  
  .menu-item a span {
    display: none; /* Show icons only on small tablets/mobile to conserve space */
  }
  
  .menu-item.active a {
    border-left: none;
    border-bottom: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding-left: 10px;
    padding-bottom: 8px;
  }
  
  .sidebar-footer {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-direction: row;
    gap: 8px;
  }
  
  .secure-badge {
    display: none; /* Hide secure badge on mobile */
  }
  
  #btn-logout {
    width: auto !important;
    padding: 8px 12px !important;
    margin-bottom: 0 !important;
    height: 34px !important;
    font-size: 0.75rem !important;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 24px 16px;
  }
  
  .board {
    grid-template-columns: 1fr; /* Stack client cards vertically */
    gap: 20px;
  }
  
  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .workspace-header > div:last-child {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .workspace-header > div:last-child button {
    flex-grow: 1;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .search-container {
    max-width: none;
  }
  
  .filter-tabs {
    overflow-x: auto;
    padding: 2px;
  }
  
  .filter-tab {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}

/* Custom Color Dot Picker */
.color-picker-wrapper {
  position: relative;
  display: inline-block;
  margin-top: 4px;
}

.active-color-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  cursor: pointer;
  background-color: #2dd4bf; /* default teal */
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.active-color-dot:hover {
  transform: scale(1.12);
}

/* Map background colors based on team color class name */
.active-color-dot.alpha, .color-option-dot.alpha { background-color: #2dd4bf; box-shadow: 0 0 12px rgba(45, 212, 191, 0.45); }
.active-color-dot.bravo, .color-option-dot.bravo { background-color: #f472b6; box-shadow: 0 0 12px rgba(244, 114, 182, 0.45); }
.active-color-dot.charlie, .color-option-dot.charlie { background-color: #a78bfa; box-shadow: 0 0 12px rgba(167, 139, 250, 0.45); }
.active-color-dot.delta, .color-option-dot.delta { background-color: #60a5fa; box-shadow: 0 0 12px rgba(96, 165, 250, 0.45); }
.active-color-dot.echo, .color-option-dot.echo { background-color: #fbbf24; box-shadow: 0 0 12px rgba(251, 191, 36, 0.45); }
.active-color-dot.foxtrot, .color-option-dot.foxtrot { background-color: #34d399; box-shadow: 0 0 12px rgba(52, 211, 153, 0.45); }

.color-dots-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background-color: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: menuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.color-dots-menu.hidden {
  display: none;
}

.color-option-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-option-dot:hover {
  transform: scale(1.15);
  border-color: #ffffff;
}

.color-option-dot.selected {
  border: 2px solid #ffffff;
  transform: scale(1.1);
}

/* Activity Log & Timeline Styling */
.timeline-container {
  max-width: 1000px;
  margin: 0 auto;
}

.timeline-list {
  list-style: none;
  position: relative;
  padding-left: 28px;
  margin: 0;
}

/* Vertical timeline guide line */
.timeline-list::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  animation: itemSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Timeline dot */
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  background-color: var(--text-muted);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

/* Colored timeline dots depending on action type */
.timeline-item.log-create .timeline-dot { background-color: #6366f1; box-shadow: 0 0 8px rgba(99, 102, 241, 0.5); }
.timeline-item.log-update .timeline-dot { background-color: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.timeline-item.log-completed .timeline-dot { background-color: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.timeline-item.log-delete .timeline-dot { background-color: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.timeline-item.log-archive .timeline-dot { background-color: #6b7280; box-shadow: 0 0 8px rgba(107, 114, 128, 0.5); }

.timeline-content {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.timeline-content:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}

.timeline-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-action {
  font-size: 0.85rem;
  color: #ffffff;
  line-height: 1.4;
}

.timeline-action strong {
  color: var(--text-normal);
  font-weight: 600;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-user-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-user-badge.admin {
  background-color: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
}

.timeline-user-badge.cs {
  background-color: rgba(251, 191, 36, 0.12);
  color: #fde047;
}

.timeline-user-badge.designer {
  background-color: rgba(45, 212, 191, 0.12);
  color: #99f6e4;
}

.timeline-time {
  color: var(--text-muted);
}

@keyframes itemSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.copyable-phone:hover {
  color: #38bdf8 !important;
  text-decoration: underline;
}

.blinking-red {
  color: #ef4444 !important;
  animation: blinker-red 1.2s linear infinite;
}
@keyframes blinker-red {
  50% { opacity: 0.15; }
}

input[type="date"]::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none;
}

/* Custom styled select dropdowns for Teams view */
.team-client-status-select {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 20px 3px 8px !important;
  border-radius: 100px;
  cursor: pointer;
  outline: none;
  border: 1px solid transparent;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-size: 8px !important;
  transition: all 0.2s ease;
  width: auto;
  height: 24px;
  display: inline-flex;
  align-items: center;
}

select option,
.team-client-status-select option,
.team-client-payment-select option,
.board-item-payment-select option,
.modal-select option {
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.78rem;
}

/* Printing styling for Invoice Generator */
@media print {
  body * {
    visibility: hidden !important;
  }
  #invoice-preview-modal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #ffffff !important;
    display: block !important;
    visibility: visible !important;
    z-index: 99999 !important;
  }
  #invoice-preview-modal .modal-content {
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    visibility: visible !important;
  }
  #invoice-print-area, #invoice-print-area * {
    visibility: visible !important;
  }
  #invoice-print-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
  }
  .print-hide {
    display: none !important;
  }
}
