@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Monday.com Clean Light Workspace Palette */
  --bg-body: #F5F6F8;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FB;
  --bg-sidebar: #FFFFFF;
  --bg-navbar: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-group-header: #F5F6F8;
  
  --border-color: #E6E9EF;
  --border-light: #D0D4E4;
  --border-focus: #0073EA;
  
  --text-main: #323338;
  --text-heading: #181B34;
  --text-muted: #676879;
  --text-dim: #8A8B9D;
  
  /* Monday.com Signature Status Colors */
  --monday-green: #00C875;
  --monday-green-dark: #00A35F;
  --monday-green-light: #E7F9F1;

  --monday-amber: #FDAB3D;
  --monday-amber-dark: #D48827;
  --monday-amber-light: #FFF6EA;

  --monday-red: #E2445C;
  --monday-red-dark: #C22F45;
  --monday-red-light: #FDECEF;

  --monday-purple: #A25DDC;
  --monday-purple-dark: #843EC3;
  --monday-purple-light: #F6EDFC;

  --monday-blue: #579BFC;
  --monday-blue-dark: #0073EA;
  --monday-blue-light: #EFF5FE;

  --monday-teal: #03A3B5;
  --monday-teal-light: #E6F7F9;

  --monday-gray: #C4C4C4;
  --monday-gray-dark: #676879;
  --monday-gray-light: #F0F1F3;

  /* Solid Black Action Buttons */
  --btn-black: #111111;
  --btn-black-hover: #2B2C3B;
  --btn-black-active: #000000;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 40px;
  
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 16px 36px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Main Shell */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Monday-Style Modern Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

.brand-logo {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  background: #FFFFFF;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: #000000;
  color: #FFFFFF;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111111;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 800;
  padding: 0.85rem 0.85rem 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
  margin-bottom: 0.15rem;
}

.nav-link:hover {
  background: #EAEBED;
  color: #111111;
}

.nav-link.active {
  background: #000000;
  color: #FFFFFF !important;
  font-weight: 700;
}

.nav-link.active .nav-icon,
.nav-link.active span {
  color: #FFFFFF !important;
}

.nav-icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
}

/* User Card in Sidebar */
.user-profile-widget {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: #FAFAFB;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #111111;
  object-fit: cover;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Layout Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-body);
}

.top-navbar {
  height: 64px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.content-body {
  padding: 2rem;
  flex: 1;
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
}

/* Monday-Style View Switcher Tab Bar */
.monday-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  background: #FFFFFF;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

.monday-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.monday-tab-btn:hover {
  background: #F5F6F8;
  color: #111111;
}

.monday-tab-btn.active {
  background: #FFFFFF;
  color: #0073EA;
  border-color: var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Cards & Board Containers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111111;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Monday-Style KPI Summary Widgets */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: #111111;
}

.kpi-card.cyan::before { background: var(--monday-blue); }
.kpi-card.success::before { background: var(--monday-green); }
.kpi-card.warning::before { background: var(--monday-amber); }
.kpi-card.danger::before { background: var(--monday-red); }
.kpi-card.purple::before { background: var(--monday-purple); }

.kpi-label {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-size: 1.95rem;
  font-weight: 800;
  color: #111111;
  line-height: 1.1;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

/* ==========================================================================
   MONDAY.COM SIGNATURE COLOR-BLOCK STATUS & PRIORITY CELLS
   ========================================================================== */
.monday-status-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFFFFF !important;
  text-align: center;
  min-width: 110px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, filter 0.15s ease;
  letter-spacing: 0.01em;
}

.monday-status-cell:hover {
  filter: brightness(1.05);
  transform: scale(1.02);
}

/* Monday Status Variations */
.status-completed, .status-done, .badge-approved, .badge-completed {
  background: var(--monday-green) !important;
  color: #FFFFFF !important;
}

.status-in_progress, .status-working_on_it, .badge-progress {
  background: var(--monday-amber) !important;
  color: #FFFFFF !important;
}

.status-overdue, .status-stuck, .badge-overdue, .badge-critical {
  background: var(--monday-red) !important;
  color: #FFFFFF !important;
}

.status-submitted_for_testing, .status-testing, .badge-testing-pending, .badge-testing {
  background: var(--monday-purple) !important;
  color: #FFFFFF !important;
}

.status-assigned, .status-planning, .badge-assigned {
  background: var(--monday-blue) !important;
  color: #FFFFFF !important;
}

.status-pending, .badge-pending {
  background: #797E93 !important;
  color: #FFFFFF !important;
}

.status-reopened, .badge-reopened, .badge-changes-required {
  background: #E2445C !important;
  color: #FFFFFF !important;
}

.status-draft, .badge-draft, .badge-secondary {
  background: #C4C4C4 !important;
  color: #FFFFFF !important;
}

/* Priority Cell Badges */
.monday-priority-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: #FFFFFF !important;
  min-width: 90px;
}

.priority-critical { background: #E2445C !important; }
.priority-high { background: #FF5AC4 !important; }
.priority-medium { background: #579BFC !important; }
.priority-low { background: #579BFC !important; opacity: 0.85; }

/* User Role Badges */
.user-role-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-super_admin { background: var(--monday-purple-light); color: var(--monday-purple-dark); border: 1px solid var(--monday-purple); }
.role-team_head, .role-head { background: var(--monday-orange-light); color: var(--monday-orange-dark); border: 1px solid var(--monday-orange); }
.role-staff { background: var(--monday-blue-light); color: var(--monday-blue-dark); border: 1px solid var(--monday-blue); }
.role-tester { background: var(--monday-green-light); color: var(--monday-green-dark); border: 1px solid var(--monday-green); }

/* ==========================================================================
   MONDAY.COM STYLE GROUPED TABLES
   ========================================================================== */
.monday-group {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.monday-group-header {
  padding: 1rem 1.25rem;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 6px solid #0073EA;
}

.monday-group-header.green { border-left-color: var(--monday-green); }
.monday-group-header.amber { border-left-color: var(--monday-amber); }
.monday-group-header.red { border-left-color: var(--monday-red); }
.monday-group-header.purple { border-left-color: var(--monday-purple); }
.monday-group-header.blue { border-left-color: var(--monday-blue); }

.monday-group-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111111;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.monday-group-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 700;
  background: var(--bg-body);
  padding: 2px 8px;
  border-radius: 12px;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: #FFFFFF;
}

.table-custom th {
  padding: 0.85rem 1rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 800;
  border-bottom: 1px solid var(--border-color);
  background: #F5F6F8;
  border-right: 1px solid var(--border-color);
}

.table-custom th:last-child {
  border-right: none;
}

.table-custom td {
  padding: 0.95rem 1rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-main);
  background: #FFFFFF;
  border-right: 1px solid #F5F6F8;
  transition: background-color 0.15s ease;
}

.table-custom td:last-child {
  border-right: none;
}

.table-custom tr:hover td {
  background: #F8F9FB;
}

/* Progress Cylinder */
.progress-container {
  width: 100%;
  height: 8px;
  background: #E6E9EF;
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #000000;
  border-radius: 20px;
  transition: width 0.4s ease;
}

.progress-bar.success { background: var(--monday-green); }
.progress-bar.warning { background: var(--monday-amber); }
.progress-bar.danger { background: var(--monday-red); }
.progress-bar.purple { background: var(--monday-purple); }

/* ==========================================================================
   BUTTONS (CLEAN SOLID BLACK BUTTONS WITH SHARP HOVER)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1;
  box-shadow: var(--shadow-subtle);
}

/* Primary Button: Solid Pitch Black */
.btn-primary {
  background: #000000 !important;
  color: #FFFFFF !important;
  border-color: #000000 !important;
}

.btn-primary:hover {
  background: #252636 !important;
  border-color: #252636 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

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

/* Secondary Button: Clean White with Slate Border */
.btn-secondary {
  background: #FFFFFF !important;
  border-color: var(--border-light) !important;
  color: #111111 !important;
}

.btn-secondary:hover {
  background: #F5F6F8 !important;
  border-color: #A0A4B8 !important;
  color: #000000 !important;
}

.btn-success { background: var(--monday-green) !important; color: #fff !important; }
.btn-danger { background: var(--monday-red) !important; color: #fff !important; }
.btn-warning { background: var(--monday-amber) !important; color: #fff !important; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 0.95rem; }

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #111111;
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.95rem;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: #111111;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-subtle);
}

.form-control:focus {
  outline: none;
  border-color: #0073EA;
  box-shadow: 0 0 0 3px rgba(0, 115, 234, 0.15);
}

.form-control::placeholder {
  color: #A0A4B8;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 27, 52, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-content {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  padding: 2.25rem;
  box-shadow: var(--shadow-modal);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111111;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-close:hover { color: #000000; }

/* Tag Chips */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #F0F3F9;
  border: 1px solid #D0D4E4;
  color: #181B34;
}

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

/* Toast Alerts */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-modal);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

.toast-success { background: var(--monday-green-dark); }
.toast-danger { background: var(--monday-red); }
.toast-warning { background: var(--monday-amber-dark); }
.toast-info { background: #000000; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Quick Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 9px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.timeline-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111111;
}

/* Utilities */
.text-success { color: var(--monday-green); }
.text-danger { color: var(--monday-red); }
.text-warning { color: var(--monday-amber); }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

/* Global SVG Safety Constraint: Prevents unstyled SVGs from blowing up */
svg {
  max-width: 24px;
  max-height: 24px;
  display: inline-block;
  vertical-align: middle;
}

/* Monday.com Pagination Styling */
.monday-pagination,
nav[role="navigation"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.monday-pagination nav svg,
nav[role="navigation"] svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

.monday-pagination-links,
nav[role="navigation"] > div:last-child {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-link,
nav[role="navigation"] a,
nav[role="navigation"] span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  color: #111111;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.page-link:hover:not(.disabled):not(.active),
nav[role="navigation"] a:hover {
  background: #F1F5F9;
  border-color: #000000;
  color: #000000;
}

.page-link.active,
nav[role="navigation"] span[aria-current="page"] {
  background: #000000 !important;
  color: #FFFFFF !important;
  border-color: #000000 !important;
}

.page-link.disabled,
nav[role="navigation"] span[aria-disabled="true"] {
  color: var(--text-dim);
  background: #F8FAFC;
  border-color: var(--border-color);
  cursor: not-allowed;
  opacity: 0.6;
}

