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

:root {
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;

  /* NUO Palette Tokens */
  --blue: #3A7BC8;
  --blue-900: #16407F;
  --blue-700: #2A67B5;
  --blue-500: #5B97DB;
  --blue-300: #8DB8EA;

  --emerald: #009B4E;
  --green-700: #3F7D47;
  --green-500: #6FAF69;
  --green-300: #8ABB6F;

  --magenta: #CE0A8E;
  --slate: #7A8CAD;

  --color-text-dark: #12243D;
  --color-text-muted: #5A6B82;
  --color-text-dim: #7A8CAD;
  --color-border: #DFE8F4;
  --color-track: #E6EDF7;

  --color-primary-dark: #16407F;
  --color-primary-hover: #2A67B5;
  --color-accent-magenta: #CE0A8E;
  --color-accent-coral: #6FAF69;
  --color-accent-sky: #3A7BC8;
  --color-accent-emerald: #009B4E;

  --color-bg-start: #DFE8F4;
  --color-bg-end: #EDF3FC;
  --color-shell: #ffffff;
  --color-card-bg: #ffffff;
  --color-card-border: #DFE8F4;

  --pastel-blue: #E8F1FB;
  --pastel-magenta: #FBE8F4;
  --pastel-peach: #EDF5E3;
  --pastel-coral: #E2F5EA;
  --pastel-rose: #FBEAF5;
  --pastel-mint: #E7F6EE;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 36px;

  --shadow-shell: 0 25px 60px -15px rgba(22, 64, 127, 0.08);
  --shadow-card: 0 10px 25px -5px rgba(22, 64, 127, 0.04);
  --shadow-pill: 0 8px 20px -3px rgba(22, 64, 127, 0.28);
}

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

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--color-bg-start) 0%, #cbd5e1 50%, var(--color-bg-end) 100%);
  color: var(--color-text-dark);
  min-height: 100vh;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Shell Outer Frame */
.tasklyn-shell {
  width: 100%;
  max-width: 1440px;
  background: var(--color-shell);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-shell);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 1.75rem 2.25rem;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
}

.brand-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: var(--color-primary-dark);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
}

.nav-pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 6px 8px;
  border-radius: 9999px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--color-card-border);
  flex-wrap: wrap;
}

.nav-pill {
  padding: 0.55rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  color: var(--color-text-dark);
  background: rgba(241, 245, 249, 0.8);
}

.nav-pill.active {
  background: var(--color-primary-dark);
  color: #ffffff;
  box-shadow: var(--shadow-pill);
}

.top-user-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.icon-btn:hover {
  background: var(--color-primary-dark);
  color: #ffffff;
  border-color: var(--color-primary-dark);
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  padding: 4px 14px 4px 6px;
  border-radius: 9999px;
  border: 1px solid var(--color-card-border);
}

.avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2A67B5, #3A7BC8);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Subheader Bar */
.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.25rem;
}

.sub-header-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text-dark);
}

.sub-header-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack-item {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  margin-left: -10px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-dark);
}

.avatar-stack-item:first-child {
  margin-left: 0;
}

/* Tasklyn Cards & Panels */
.panel-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-card-border);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-dark);
}

.see-all-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-dark);
  text-decoration: none;
  transition: all 0.2s ease;
}

.see-all-btn:hover {
  background: var(--color-primary-dark);
  color: #ffffff;
}

/* Pastel Today Task Cards */
.pastel-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.pastel-card {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pastel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -10px rgba(0,0,0,0.08);
}

.pastel-blue { background: var(--pastel-blue); }
.pastel-magenta { background: var(--pastel-magenta); }
.pastel-peach { background: var(--pastel-peach); }
.pastel-coral { background: var(--pastel-coral); }

.tag-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--color-text-dark);
}

.pastel-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0.6rem 0;
  line-height: 1.25;
}

/* Ring Donut Chart Visualization */
.donut-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.ring-donut-svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: #f1f5f9;
  stroke-width: 12;
}

.ring-fill-1 {
  fill: none;
  stroke: var(--blue-900);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 280;
  stroke-dashoffset: 140; /* 50% */
}

.ring-fill-2 {
  fill: none;
  stroke: var(--blue);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 210;
  stroke-dashoffset: 157; /* 25% */
}

.ring-fill-3 {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 140;
  stroke-dashoffset: 119; /* 15% */
}

/* Tracker Bar Chart */
.tracker-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 130px;
  padding-top: 1rem;
}

.tracker-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.tracker-pill-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 9999px;
  background: var(--pastel-blue);
  position: relative;
  overflow: hidden;
  transition: height 0.4s ease;
}

.tracker-pill-fill {
  width: 100%;
  background: var(--blue);
  border-radius: 9999px;
}

/* Buttons */
.btn-dark {
  background: var(--color-primary-dark);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-pill);
}

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

.btn-light {
  background: #f8fafc;
  color: var(--color-text-dark);
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--color-card-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-light:hover {
  background: var(--color-track);
}

.btn-danger {
  background: #FBEAF5;
  color: #CE0A8E;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #F0C3E1;
  cursor: pointer;
}

.btn-danger:hover {
  background: #F0C3E1;
}

/* Tables */
.tasklyn-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tasklyn-table th {
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-card-border);
}

.tasklyn-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: var(--color-text-dark);
}

.tasklyn-table tr:hover td {
  background: #f8fafc;
}

/* Form Controls */
.input, .select, .textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-dark);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.input:focus, .select:focus, .textarea:focus {
  background: #ffffff;
  border-color: var(--color-primary-hover);
  box-shadow: 0 0 0 3px rgba(42, 103, 181, 0.2);
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: 0.4rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 36, 61, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-shell);
}

/* Alerts */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #E2F5EA;
  border: 1px solid #BFE5CE;
  color: #0B6B38;
}

.alert-error {
  background: #FBEAF5;
  border: 1px solid #F0C3E1;
  color: #940A68;
}

/* Mobile Responsive Drawer Toggle */
.mobile-menu-btn {
  display: none;
}

@media (max-width: 1024px) {
  body {
    padding: 0.75rem;
  }
  .tasklyn-shell {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
  .nav-pill-group {
    display: none; /* Collapsible or scrollable on mobile */
    width: 100%;
    overflow-x: auto;
  }
  .nav-pill-group.mobile-open {
    display: flex;
  }
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .top-user-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   ✨ NUO GLOBAL ENTRANCE ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================== */

/* Keyframe Definitions */
@keyframes pageFadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardGlideIn {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes columnSlideIn {
  0% {
    opacity: 0;
    transform: translateX(16px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Page Main Shell Entrance */
.app-page-main {
  animation: pageFadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
}

/* Staggered Sections across any page */
.app-page-main > *:nth-child(1) {
  animation: pageFadeSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.04s both;
}
.app-page-main > *:nth-child(2) {
  animation: pageFadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.09s both;
}
.app-page-main > *:nth-child(3) {
  animation: pageFadeSlideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.14s both;
}
.app-page-main > *:nth-child(4) {
  animation: pageFadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.19s both;
}
.app-page-main > *:nth-child(5) {
  animation: pageFadeSlideUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.24s both;
}
.app-page-main > *:nth-child(n+6) {
  animation: pageFadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.29s both;
}

/* Staggered Executive Stat Cards (Dashboard & Member Views) */
.executive-stat-card {
  animation: cardGlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, box-shadow;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.2s ease !important;
}
.executive-stat-card:nth-child(1) { animation-delay: 0.06s; }
.executive-stat-card:nth-child(2) { animation-delay: 0.12s; }
.executive-stat-card:nth-child(3) { animation-delay: 0.18s; }
.executive-stat-card:nth-child(4) { animation-delay: 0.24s; }

/* Dashboard Middle Row Cards */
.exec-performance-chart-card {
  animation: cardGlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.exec-performance-status-card {
  animation: cardGlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

/* White Bento Cards & Linear Task Rows */
.white-bento-card {
  animation: cardGlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.26s both;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease !important;
}
.linear-task-light {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
}
.linear-task-light:hover {
  transform: translateX(4px) translateY(-1px);
}

/* Member Performance Cards Stagger */
.member-performance-card {
  animation: cardGlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease !important;
}
.member-performance-card:nth-child(1) { animation-delay: 0.05s; }
.member-performance-card:nth-child(2) { animation-delay: 0.10s; }
.member-performance-card:nth-child(3) { animation-delay: 0.15s; }
.member-performance-card:nth-child(4) { animation-delay: 0.20s; }
.member-performance-card:nth-child(5) { animation-delay: 0.25s; }
.member-performance-card:nth-child(6) { animation-delay: 0.30s; }
.member-performance-card:nth-child(7) { animation-delay: 0.35s; }
.member-performance-card:nth-child(8) { animation-delay: 0.40s; }

/* Database Project Cards (pk-card) */
.pk-card {
  animation: cardGlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease !important;
}
.pk-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(22, 64, 127, 0.1);
}

/* Kanban Board Columns (tasks/index.blade.php) */
.kanban-column {
  animation: columnSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.kanban-column:nth-child(1) { animation-delay: 0.08s; }
.kanban-column:nth-child(2) { animation-delay: 0.16s; }
.kanban-column:nth-child(3) { animation-delay: 0.24s; }
.kanban-column:nth-child(4) { animation-delay: 0.32s; }

.kanban-task-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
}
.kanban-task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(22, 64, 127, 0.09);
}

/* Micro-interactions: Buttons & Pills */
.nav-pill {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.nav-pill:not(.active):hover {
  transform: translateY(-1px);
  color: var(--blue-900);
}
.nav-pill:active {
  transform: scale(0.97);
}

.icon-btn {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background-color 0.2s ease !important;
}
.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(42, 103, 181, 0.18);
}
.icon-btn:active {
  transform: scale(0.94);
}

.btn-primary, .btn-dark, .pk-btn-primary, .kanban-btn-add {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease !important;
}
.btn-primary:hover, .btn-dark:hover, .pk-btn-primary:hover, .kanban-btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 64, 127, 0.25);
}
.btn-primary:active, .btn-dark:active, .pk-btn-primary:active, .kanban-btn-add:active {
  transform: scale(0.98);
}

/* Table Card Entrance */
.table-card, .data-table-wrapper {
  animation: cardGlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .app-page-main,
  .app-page-main > *,
  .executive-stat-card,
  .exec-performance-chart-card,
  .exec-performance-status-card,
  .white-bento-card,
  .member-performance-card,
  .pk-card,
  .kanban-column,
  .table-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

