:root {
  --bg-canvas: #f4f5f7;
  --bg-card: #ffffff;
  --border-color: #eaecf0;
  --border-subtle: #f1f3f5;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --primary-dark: #143d2c;
  --primary-dark-hover: #0f2e21;
  --primary-green: #22c55e;
  --primary-mint: #34d399;
  --primary-mint-light: #ecfdf5;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fef3c7;
  --accent-purple: #8b5cf6;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 9999px;
  --font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
}

/* ==================== LEFT SIDEBAR ==================== */
.sidebar-layout {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--primary-mint-light);
  border: 2px solid var(--primary-dark);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.3px;
}

.nav-section {
  margin-bottom: 1.75rem;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-item:hover {
  background: #f8fafc;
  color: var(--text-main);
}

.nav-item.active {
  background: #f0fdf4;
  color: var(--primary-dark);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  background: var(--primary-dark);
  border-radius: 0 4px 4px 0;
}

.nav-badge {
  background: var(--primary-dark);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}

.sidebar-bottom-promo {
  margin-top: auto;
  background: linear-gradient(145deg, #123726 0%, #0c261a 100%);
  border-radius: 16px;
  padding: 1.25rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.promo-wave {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.25) 0%, rgba(20, 61, 44, 0) 70%);
  pointer-events: none;
}

.promo-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.promo-subtitle {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.btn-promo {
  background: var(--primary-green);
  color: #062616;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  width: 100%;
  text-align: center;
}

/* ==================== MAIN CONTENT AREA ==================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-canvas);
}

/* Top Navbar */
.top-header {
  height: 76px;
  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: 50;
}

.search-box-wrapper {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.1rem;
  width: 360px;
  gap: 0.6rem;
}

.search-box-wrapper input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  color: var(--text-main);
  width: 100%;
}

.kbd-badge {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-button:hover {
  background: #f8fafc;
  color: var(--text-main);
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-color);
  cursor: pointer;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-title {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== DASHBOARD BODY ==================== */
.dashboard-container {
  padding: 2rem;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-heading h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.page-heading p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-pill-primary {
  background: var(--primary-dark);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(20, 61, 44, 0.2);
}

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

.btn-pill-outline {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pill-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* ==================== 4 TOP STAT CARDS ==================== */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.06);
}

.stat-card.hero-dark {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-dark .stat-card-title {
  color: #e2e8f0;
}

.stat-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 0.85rem;
}

.hero-dark .stat-arrow-btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 0.65rem;
}

.stat-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-dark .stat-badge-pill {
  color: #86efac;
}

.stat-tag-mini {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-weight: 700;
}

.hero-dark .stat-tag-mini {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

/* ==================== MIDDLE ROW GRID ==================== */
.middle-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 1.1fr;
  gap: 1.25rem;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Analytics Bar Chart (Donezo Pill Bars) */
.analytics-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 160px;
  padding-top: 1.5rem;
}

.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.chart-pill-bar {
  width: 32px;
  border-radius: var(--radius-pill);
  transition: height 0.4s ease;
  position: relative;
}

.bar-striped {
  background: repeating-linear-gradient(
    45deg,
    #e2e8f0,
    #e2e8f0 4px,
    #f8fafc 4px,
    #f8fafc 8px
  );
  border: 1px solid #cbd5e1;
}

.bar-solid-light {
  background: #34d399;
}

.bar-solid-dark {
  background: var(--primary-dark);
}

.bar-tooltip {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.bar-day-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-subtle);
}

/* Reminder Card */
.reminder-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.reminder-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.reminder-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.btn-meeting {
  background: var(--primary-dark);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-meeting:hover {
  background: var(--primary-dark-hover);
}

/* Target Roles Mini List */
.roles-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.role-mini-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.role-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.role-mini-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.role-mini-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== BOTTOM ROW GRID ==================== */
.bottom-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 1.1fr;
  gap: 1.25rem;
}

/* Applications Table/List */
.applicant-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.applicant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
}

.applicant-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.applicant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.applicant-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.applicant-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.status-completed {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-inprogress {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.status-pending {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Project Progress Donut */
.progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.semi-donut-wrapper {
  position: relative;
  width: 170px;
  height: 95px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.donut-svg {
  width: 170px;
  height: 95px;
}

.donut-center-text {
  position: absolute;
  bottom: 0;
  text-align: center;
}

.donut-percentage {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.donut-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.progress-legend {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

/* Time Tracker Widget */
.time-tracker-card {
  background: linear-gradient(145deg, #092617 0%, #03150c 100%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.time-tracker-wave {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 50% 120%, rgba(34, 197, 94, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.tracker-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #9ca3af;
  z-index: 1;
}

.digital-timer {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -1px;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  margin: 1rem 0;
  z-index: 1;
}

.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 1;
}

.btn-timer-control {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-timer-control:hover {
  transform: scale(1.05);
}

.btn-timer-stop {
  background: #ef4444;
  color: #ffffff;
}

/* ==================== WORKSPACE PANELS ==================== */
.workspace-panel {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.workspace-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

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

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

input[type="text"], textarea, select {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-family: var(--font-family);
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

input[type="text"]:focus, textarea:focus, select:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(20, 61, 44, 0.1);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-card {
  background: #ffffff;
  border-radius: 20px;
  width: 92%;
  max-width: 620px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(15px);
  transition: transform 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  background: var(--primary-dark);
  color: #ffffff;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Print */
@media print {
  body { background: #fff !important; }
  .sidebar-layout, .top-header, .page-header-row, .stat-cards-grid, .middle-grid, .bottom-grid, .tab-nav-bar, .editor-actions {
    display: none !important;
  }
  .main-wrapper, .dashboard-container, .workspace-panel {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .middle-grid, .bottom-grid {
    grid-template-columns: 1fr;
  }
  .stat-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar-layout { display: none; }
  .stat-cards-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
