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

:root {
  --bg-color: #0D1117;
  --card-bg: #161B22;
  --card-border: #30363D;
  --text-primary: #E6EDF3;
  --text-muted: #8B949E;
  --accent: #4A90D9;
  --accent-glow: rgba(74, 144, 217, 0.15);
  --success: #27AE60;
  --error: #FF4D4D;
  --warning: #F39C12;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --border-radius: 12px;
  --transition-speed: 0.3s;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes skeletonPulse {
  0% {
    background-color: #161B22;
  }

  50% {
    background-color: #21262D;
  }

  100% {
    background-color: #161B22;
  }
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 4px var(--bar-color, var(--accent));
    filter: brightness(1);
  }

  50% {
    box-shadow: 0 0 16px var(--bar-color, var(--accent));
    filter: brightness(1.2);
  }

  100% {
    box-shadow: 0 0 4px var(--bar-color, var(--accent));
    filter: brightness(1);
  }
}

@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Unconfigured Banner */
.config-warning-banner {
  background-color: var(--warning);
  color: #000;
  text-align: center;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.4s var(--transition-ease);
  position: relative;
  z-index: 1000;
}

.config-warning-banner code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Landing Page Layout */
.landing-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 24px;
  position: relative;
  background: radial-gradient(circle at 50% -20%, rgba(74, 144, 217, 0.15) 0%, rgba(13, 17, 23, 0) 60%);
}

.landing-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.5s var(--transition-ease);
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.logo-text {
  font-size: 2.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text .text-gradient {
  background: linear-gradient(135deg, #38BDF8 0%, #2563EB 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text .text-outline {
  color: transparent;
  -webkit-text-stroke: 1.1px #E5E7EB;
  font-weight: 500;
  margin-left: 2px;
  letter-spacing: 2px;
}

.landing-tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

/* Google Sign-In Button */
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: #FFFFFF;
  color: #1F2022;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-google:hover {
  transform: translateY(-2px);
  background-color: #F7F7F7;
  box-shadow: 0 6px 20px rgba(74, 144, 217, 0.3);
}

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

.btn-google svg {
  width: 20px;
  height: 20px;
}

/* Premium SVG Logo Styles */
.logo-svg {
  width: 38px;
  height: 32px;
  flex-shrink: 0;
  display: block;
}

.logo-svg-large {
  width: 240px;
  height: 180px;
  display: block;
  margin: 0 auto;
}

/* Base transitions */
.logo-bar-1,
.logo-bar-2,
.logo-bar-3,
.logo-bar-4,
.logo-plus,
.logo-badge-red,
.logo-badge-green {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading animations */
.logo-loading .logo-bar-1 {
  animation: logoBarPulse 1.4s infinite ease-in-out;
  transform-origin: 68px 108px;
}

.logo-loading .logo-bar-2 {
  animation: logoBarPulse 1.4s infinite ease-in-out 0.15s;
  transform-origin: 92px 108px;
}

.logo-loading .logo-bar-3 {
  animation: logoBarPulse 1.4s infinite ease-in-out 0.3s;
  transform-origin: 116px 108px;
}

.logo-loading .logo-bar-4 {
  animation: logoBarPulse 1.4s infinite ease-in-out 0.45s;
  transform-origin: 140px 108px;
}

.logo-loading .logo-plus {
  animation: logoPulseGlow 1.4s infinite ease-in-out;
}

.logo-loading .logo-badge-red {
  animation: logoBadgePulse 1.4s infinite ease-in-out 0.3s;
  transform-origin: 0px 0px;
}

.logo-loading .logo-badge-green {
  animation: logoBadgePulse 1.4s infinite ease-in-out 0.45s;
  transform-origin: 0px 0px;
}

@keyframes logoBarPulse {

  0%,
  100% {
    transform: scaleY(1);
  }

  50% {
    transform: scaleY(0.4);
  }
}

@keyframes logoPulseGlow {

  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.3));
  }

  50% {
    opacity: 0.5;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
  }
}

@keyframes logoBadgePulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.85);
  }
}

/* Navbar Layout */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(13, 17, 23, 0.8);
  border-bottom: 1px solid var(--card-border);
  padding: 12px 24px;
  will-change: transform;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.nav-logo:hover {
  opacity: 0.9;
}

.nav-logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.nav-logo-text .text-gradient {
  background: linear-gradient(135deg, #38BDF8 0%, #2563EB 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-logo-text .text-outline {
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-text-stroke: 1.25px #E5E7EB;
  font-weight: 500;
  margin-left: 1px;
  letter-spacing: 0.75px;
  paint-order: stroke fill;
}

/* Toolbar layout */
.nav-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-refresh-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.nav-refresh-btn:hover {
  color: var(--text-primary);
}

.nav-refresh-btn:active {
  transform: scale(0.9);
}

.nav-download-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.nav-download-btn:hover {
  color: var(--text-primary);
}

.nav-download-btn:active {
  transform: scale(0.9);
}

.nav-github-link {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.nav-github-link svg {
  width: 22.65px;
  height: 22.65px;
  display: block;
}

.nav-github-link:hover {
  color: var(--text-primary);
  transform: scale(1.05);
}

.version-selector {
  display: flex;
  align-items: center;
}

.version-select {
  background-color: #0D1117;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 24px 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B949E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.version-select:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A90D9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* User Profile Badge Menu */
.profile-menu-container {
  position: relative;
}

.profile-badge-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-badge-btn:hover {
  transform: scale(1.05);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  background-color: #1F242C;
  object-fit: cover;
  transition: border-color var(--transition-speed) ease;
}

.profile-badge-btn:hover .user-avatar {
  border-color: var(--accent);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  background: rgba(13, 17, 23, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
  z-index: 110;
}

.profile-dropdown.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.dropdown-header {
  margin-bottom: 12px;
}

.dropdown-user-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--card-border);
  margin: 12px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.dropdown-item:hover {
  border-color: var(--error);
  color: var(--error);
  background-color: rgba(255, 77, 77, 0.05);
}

/* Overall Stats Bar (3D Glossy Buttons) - Smaller & Centered */
.stats-banner {
  position: sticky;
  top: calc(var(--navbar-height, 57px) + var(--subbar-height, 0px));
  z-index: 98;
  background-color: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 14px 16px;
  animation: fadeIn 0.4s var(--transition-ease);
  will-change: transform;
}

.stats-skeleton {
  display: inline-block;
  width: 24px;
  height: 16px;
  border-radius: 4px;
  animation: skeletonPulse 1.5s infinite;
  vertical-align: middle;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  overflow: visible;
  /* Prevent any vertical clipping on desktop */
  padding: 8px 0;
}

.stats-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: rgba(22, 27, 34, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0px rgba(255, 255, 255, 0.05);
}

.stats-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.stats-btn:hover {
  transform: translateY(-1.5px);
  border-color: rgba(255, 255, 255, 0.15);
  background-color: rgba(22, 27, 34, 0.5);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0px rgba(255, 255, 255, 0.1);
}

.stats-btn:active {
  transform: translateY(0.5px);
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.3);
}

/* Icons styling */
.stats-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.stats-icon-wrapper svg {
  width: 14px;
  height: 14px;
}

.val-blue {
  background-color: rgba(59, 130, 246, 0.12);
  color: #3B82F6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.val-orange {
  background-color: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.val-red {
  background-color: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.val-green {
  background-color: rgba(34, 197, 94, 0.12);
  color: #22C55E;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.val-purple {
  background-color: rgba(168, 85, 247, 0.12);
  color: #A855F7;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.stats-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stats-num {
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  transition: all 0.25s ease;
}

.stats-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: all 0.25s ease;
}

/* Active Button Glossy States */
.stats-btn.active[data-filter="all"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.06) 100%);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25), inset 0 1.5px 3px rgba(0, 0, 0, 0.2);
}

.stats-btn.active[data-filter="all"] .stats-icon-wrapper {
  background-color: #3B82F6;
  color: #111827;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.stats-btn.active[data-filter="deadlines"] {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.06) 100%);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25), inset 0 1.5px 3px rgba(0, 0, 0, 0.2);
}

.stats-btn.active[data-filter="deadlines"] .stats-icon-wrapper {
  background-color: #F59E0B;
  color: #111827;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.stats-btn.active[data-filter="overdue"] {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(239, 68, 68, 0.06) 100%);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25), inset 0 1.5px 3px rgba(0, 0, 0, 0.2);
}

.stats-btn.active[data-filter="overdue"] .stats-icon-wrapper {
  background-color: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.stats-btn.active[data-filter="completed"] {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0.06) 100%);
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25), inset 0 1.5px 3px rgba(0, 0, 0, 0.2);
}

.stats-btn.active[data-filter="completed"] .stats-icon-wrapper {
  background-color: #22C55E;
  color: #111827;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.stats-btn.active[data-filter="flexible"] {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18) 0%, rgba(168, 85, 247, 0.06) 100%);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25), inset 0 1.5px 3px rgba(0, 0, 0, 0.2);
}

.stats-btn.active[data-filter="flexible"] .stats-icon-wrapper {
  background-color: #A855F7;
  color: #FFFFFF;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.4);
}

/* Divider between buttons */
.stats-divider {
  width: 1px;
  height: 20px;
  background-color: var(--card-border);
  margin: 0 4px;
}

@media (max-width: 600px) {
  .stats-label {
    display: none;
  }

  .stats-btn.active .stats-label {
    display: inline-block;
    grid-area: label;
    justify-self: center;
    width: 100%;
    margin-top: 2px;
    font-size: 0.7rem;
    text-align: center;
  }

  .stats-btn {
    display: grid;
    grid-template-areas:
      "icon num"
      "label label";
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    gap: 4px 6px;
    padding: 6px 10px;
    border-radius: 8px;
  }

  .stats-icon-wrapper {
    grid-area: icon;
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }

  .stats-icon-wrapper svg {
    width: 12px;
    height: 12px;
  }

  .stats-info {
    display: contents;
  }

  .stats-num {
    grid-area: num;
    font-size: 0.85rem;
    justify-self: start;
  }

  .stats-divider {
    display: none;
  }

  .stats-container {
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide scrollbar on Firefox */
    padding: 6px 0;
    /* Add vertical padding for mobile hover/scale space */
  }

  .stats-container::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar on Chrome/Safari */
  }
}



/* Dashboard Content */
.dashboard-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px 24px;
  animation: fadeIn 0.4s var(--transition-ease);
}

/* Dashboard Controls */
.dashboard-controls {
  position: sticky;
  top: calc(var(--navbar-height, 57px) + var(--subbar-height, 0px) + var(--stats-height, 0px) - 2px);
  z-index: 97;
  background-color: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 24px;
  margin: -2px -24px 12px -24px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  will-change: transform;
}

.sort-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  height: 38px;
  transition: all 0.2s ease;
}

.sort-container.danger-active {
  border-color: rgba(239, 68, 68, 0.4) !important;
  background-color: rgba(239, 68, 68, 0.08) !important;
}

.sort-container.danger-active:hover {
  border-color: rgba(239, 68, 68, 0.8) !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
}

.sort-container.danger-active .delete-del-btn {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.85rem;
}

.select-del-title {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sort-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1;
}

.sort-select {
  background: transparent;
  border: none;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

.sort-select option {
  background-color: var(--card-bg);
  color: var(--text-primary);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 600px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Progress Card Styles */
.card-progress {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 24px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 180px;
  height: auto;
  transition: transform var(--transition-speed) var(--transition-ease),
    border-color var(--transition-speed) var(--transition-ease),
    box-shadow var(--transition-speed) var(--transition-ease);
}

.card-progress:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px var(--accent-glow);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-right: 72px;
  display: flex;
  align-items: center;
}

.card-title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  /* Force title to wrap up to 2 lines */
}



.card-body {
  margin-top: auto;
  margin-bottom: auto;
}

.card-percent {
  font-size: 1.8rem;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

/* Progress Bar Track */
.progressbar-track {
  height: 8px;
  width: 100%;
  background-color: #30363D;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

/* Progress Bar Fill */
.progressbar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--bar-color, var(--accent));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glow animation class */
.pulse-glow .progressbar-fill {
  animation: pulse-glow 2s infinite ease-in-out;
}

.card-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Add Card Styles */
.card-add {
  background-color: transparent;
  border: 2px dashed var(--card-border);
  border-radius: var(--border-radius);
  min-height: 180px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  gap: 12px;
  transition: all var(--transition-speed) var(--transition-ease);
}

.card-add:hover {
  border-color: var(--accent);
  background-color: rgba(74, 144, 217, 0.02);
  transform: scale(0.99);
}

.add-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #1F242C;
  border: 1px solid var(--card-border);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: 300;
  transition: all var(--transition-speed) var(--transition-ease);
}

.card-add:hover .add-icon {
  background-color: var(--accent);
  color: #FFF;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(74, 144, 217, 0.4);
}

.add-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-speed) var(--transition-ease);
}

.card-add:hover .add-text {
  color: var(--text-primary);
}

/* Skeleton Loading Cards */
.card-skeleton {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 24px;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  border-radius: 4px;
  animation: skeletonPulse 1.5s infinite;
}

.skeleton-percent {
  height: 32px;
  width: 40%;
  border-radius: 4px;
  animation: skeletonPulse 1.5s infinite;
}

.skeleton-bar {
  height: 8px;
  width: 100%;
  border-radius: 4px;
  animation: skeletonPulse 1.5s infinite;
}

.skeleton-label {
  height: 16px;
  width: 80%;
  border-radius: 4px;
  animation: skeletonPulse 1.5s infinite;
}

/* Empty State Styles */
.empty-state {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 20px;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.4s var(--transition-ease);
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.empty-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 12, 16, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

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

.modal-container {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}

.modal-container form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
  opacity: 1;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFF;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group.transition-group {
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  overflow: hidden;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background-color: rgba(13, 17, 23, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #FFF;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  background: rgba(22, 27, 34, 0.6);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.form-row-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

/* Dynamic sub-forms */
.dynamic-ratio-section,
.custom-levels-config {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s var(--transition-ease);
}

.custom-level-row {
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.custom-level-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Button UI Components */
.btn {
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--card-border);
  color: var(--text-muted);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-primary {
  background-color: var(--accent);
  color: #FFF;
}

.btn-primary:hover {
  background-color: #357ABD;
  box-shadow: 0 0 12px rgba(74, 144, 217, 0.3);
}

.btn-danger {
  background-color: transparent;
  border-color: var(--card-border);
  color: var(--text-muted);
}

.btn-danger:hover {
  background-color: rgba(255, 77, 77, 0.08);
  border-color: var(--error);
  color: var(--error);
}

.btn-danger-confirm {
  background-color: var(--error);
  color: #FFF;
}

.btn-danger-confirm:hover {
  background-color: #CC3D3D;
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.3);
}

/* Delete Safety Panel (inside update modal) */
.delete-safety-panel {
  background-color: rgba(255, 77, 77, 0.05);
  border: 1px dashed var(--error);
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.25s var(--transition-ease);
}

.delete-safety-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.delete-safety-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  width: calc(100% - 48px);
}

.toast {
  background-color: #1C2128;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-error {
  border-left-color: var(--error);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-warning {
  border-left-color: var(--warning);
}

.toast-message {
  flex-grow: 1;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.4;
}

.btn-close-toast {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.btn-close-toast:hover {
  color: var(--text-primary);
}

.toast.toast-out {
  animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile responsive fixes (Screens below 480px) */
@media (max-width: 480px) {
  .navbar {
    padding: 12px 16px;
  }

  .nav-logo-text {
    font-size: 1.15rem;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
  }

  .btn-logout {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  .dashboard-main {
    padding: 0 16px 24px 16px;
  }

  .dashboard-controls {
    padding: 12px 16px;
    margin: -2px -16px 12px -16px !important;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-container {
    border-radius: 12px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 16px;
    gap: 8px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  #update-actions-standard {
    flex-direction: column-reverse;
    gap: 12px;
  }

  #update-actions-standard>div {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  #update-actions-standard button {
    flex: 1;
    width: 100%;
  }

  #update-actions-standard #btn-delete-trigger {
    width: 100%;
  }

  /* Reposition toast to be centered-like on mobile margins */
  .toast-container {
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: calc(100% - 32px);
  }
}

/* --- Redesigned Stepper Styles --- */
.stepper-horizontal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.stepper-btn {
  height: 48px;
  width: 48px;
  border-radius: 8px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.stepper-btn:hover {
  border-color: var(--accent);
  background-color: rgba(74, 144, 217, 0.1);
}

.stepper-btn:active {
  transform: scale(0.95);
}

.stepper-input {
  height: 48px;
  width: 100px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  background-color: #0D1117;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: #FFF;
  font-family: var(--font-family);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.stepper-input::-webkit-inner-spin-button,
.stepper-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-multi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 24px 0;
}

.stepper-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  gap: 12px;
}

.stepper-card-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stepper-card-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-card-controls .stepper-btn {
  height: 40px;
  width: 40px;
  font-size: 1.25rem;
}

.stepper-card-controls .stepper-input {
  height: 40px;
  width: 70px;
  font-size: 1.2rem;
}

/* --- Guest Mode & Banner Styles --- */
.btn-guest {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid #30363D;
  border-radius: 8px;
  color: #8B949E;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-guest:hover {
  border-color: #8B949E;
  color: #E6EDF3;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #444C56;
  font-size: 13px;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #30363D;
}

.auth-hint {
  font-size: 12px;
  color: #444C56;
  text-align: center;
  margin-top: 8px;
  line-height: 1.6;
}

.guest-banner {
  width: 100%;
  background: #1C2128;
  border-bottom: 1px solid #30363D;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #8B949E;
  box-sizing: border-box;
}

.btn-banner-login {
  background: #4A90D9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-banner-login:hover {
  background: #357ABD;
}

.notification-banner {
  background-color: rgba(74, 144, 217, 0.1) !important;
  border: 1px solid rgba(74, 144, 217, 0.2) !important;
  border-radius: 8px;
  color: var(--text-primary) !important;
  margin-top: 12px;
  margin-bottom: 16px;
  padding: 12px 24px;
}

/* --- Card Actions (Edit / Delete) --- */
.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: center;
  z-index: 10;
}

.btn-card-edit,
.btn-card-delete {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8B949E;
  transition: background 0.15s, color 0.15s;
  /* Minimum touch target for mobile */
  min-width: 30px;
  min-height: 30px;
}

.btn-card-edit:hover {
  background: rgba(74, 144, 217, 0.15);
  color: #4A90D9;
}

.btn-card-delete:hover {
  background: rgba(231, 76, 60, 0.15);
  color: #E74C3C;
}

/* --- Inline Card Delete Confirmation Overlay --- */
.card-delete-confirm {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.93);
  backdrop-filter: blur(4px);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 20;
  padding: 20px;
  animation: fadeInScale 0.15s ease;
}

.card-delete-confirm.hidden {
  display: none;
}

.card-delete-confirm-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.card-delete-confirm-actions {
  display: flex;
  gap: 10px;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.card-divider {
  border: 0;
  height: 1px;
  background: var(--card-border);
  margin: 12px 0 0 0;
  width: 100%;
  margin-top: auto;
}

/* Deadline SVG Border styles */
.card-progress>*:not(.card-actions):not(.card-delete-confirm):not(.deadline-svg) {
  position: relative;
  z-index: 1;
}

.card-actions {
  position: absolute;
  z-index: 3;
}

.deadline-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.deadline-track {
  stroke: rgba(255, 255, 255, 0.04);
}

.deadline-bar {
  transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease;
}

@keyframes deadline-overdue-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.deadline-overdue {
  animation: deadline-overdue-pulse 1.5s ease-in-out infinite;
}

.card-deadline-label.overdue {
  color: #E74C3C !important;
  font-weight: 600;
  animation: deadline-overdue-pulse 1.5s ease-in-out infinite;
}

.badge-completed {
  background-color: rgba(39, 174, 96, 0.12);
  color: #2ECC71;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(39, 174, 96, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: deadline-overdue-pulse 2s ease-in-out infinite;
}

.form-row-group-wrapper.side-by-side {
  display: flex;
  gap: 16px;
}

.form-row-group-wrapper.side-by-side>.form-group {
  flex: 1;
  margin-bottom: 0;
}

input.form-input-date {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B949E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

input.form-input-time {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B949E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

input.form-input-date,
input.form-input-time {
  position: relative;
}

/* Custom placeholder styling for native date/time inputs when empty and not focused */
input[type="date"]:not(.has-value):not(:focus),
input[type="time"]:not(.has-value):not(:focus) {
  color: transparent !important;
}

input[type="date"]:not(.has-value):not(:focus)::before {
  content: attr(placeholder);
  color: var(--text-muted);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: inherit;
}

input[type="time"]:not(.has-value):not(:focus)::before {
  content: attr(placeholder);
  color: var(--text-muted);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: inherit;
}

input[type="date"],
input[type="time"] {
  position: relative;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Modal Deadline Input Styles */
.deadline-box {
  margin-top: 28px !important;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.form-label-optional {
  font-size: 11px;
  color: #8B949E;
  margin-left: 6px;
  font-weight: 400;
}

.deadline-way-label {
  display: block;
  font-size: 11px;
  color: #8B949E;
  margin-bottom: 6px;
}

.deadline-relative-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.deadline-relative-inputs .form-input {
  width: 72px;
  text-align: center;
}

.deadline-sep {
  font-size: 13px;
  color: #8B949E;
}

.deadline-or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #444C56;
  font-size: 12px;
  margin: 12px 0;
}

.deadline-or-divider::before,
.deadline-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #30363D;
}

.deadline-absolute-inputs {
  display: flex;
  gap: 8px;
}

.deadline-absolute-inputs .form-input {
  flex: 1;
}

@media (max-width: 480px) {
  .deadline-absolute-inputs {
    flex-direction: column;
  }

  .nav-logo-text {
    display: none;
  }

  .nav-left {
    gap: 8px;
  }

  .navbar {
    padding: 12px 16px;
  }
}

/* Empty State Dashboard Styling */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  background-color: var(--card-bg);
  border: 1.5px dashed var(--card-border);
  border-radius: var(--border-radius);
  max-width: 460px;
  margin: 32px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.4s var(--transition-ease);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.45;
}

/* --- Global Navbar Search Bar (Icon-only / Collapsed by default) --- */
.nav-search-container {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Invisible input when collapsed */
.nav-search-container .nav-search-input {
  width: 0;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.88rem;
  transition: opacity 0.2s ease;
}

/* Position button absolute to occupy full area when collapsed */
.nav-search-container .nav-search-btn {
  position: absolute;
  right: 0;
  top: 0;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.nav-search-container .nav-search-btn:hover {
  background-color: #30363d;
  color: #fff;
}

.nav-search-container .nav-search-btn:active {
  transform: scale(0.95);
}

.search-icon {
  stroke: currentColor;
  display: block;
}

/* --- Pill Mode (Expanded on Desktop / Wide screens) --- */
.nav-search-container.search-pill-mode {
  display: flex;
  align-items: center;
  background-color: #0b0d10;
  /* Slate/dark theme background */
  border: 1px solid #21262d;
  /* Sleek thin border */
  border-radius: 9999px;
  /* Perfect pill shape */
  padding: 3px 3px 3px 16px;
  /* Left padding for text, small padding on right for nested button */
  gap: 8px;
  width: 100%;
  max-width: 341px;
  min-width: 0;
  /* Dynamic width */
  margin: 0 22.65px;
  /* Spacing logo (left) and toolbar (right) */
  height: 32px;
  cursor: default;
  overflow: visible;
  flex-shrink: 1;
}

.nav-search-container.search-pill-mode:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.nav-search-container.search-pill-mode .nav-search-input {
  width: 100%;
  opacity: 1;
  pointer-events: auto;
  padding: 6px 0;
}

.nav-search-container.search-pill-mode .nav-search-btn {
  position: relative;
  right: auto;
  top: auto;
  background-color: #1f242c;
  width: 26px;
  height: 26px;
}

.nav-search-container.search-pill-mode .nav-search-btn svg {
  width: 14px;
  height: 14px;
}

/* Clear button */
.nav-search-clear {
  background: transparent;
  border: none;
  outline: none;
  color: #57606a;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.nav-search-clear:hover {
  color: var(--text-primary);
}

.nav-search-clear.hidden {
  display: none !important;
}

.nav-search-input::placeholder {
  color: #57606a;
  /* Muted placeholder color */
}

/* Hide WebKit and standard native clear search buttons */
.nav-search-input::-webkit-search-decoration,
.nav-search-input::-webkit-search-cancel-button,
.nav-search-input::-webkit-search-results-button,
.nav-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* --- Mobile Expanded State Overlaying Entire Navbar --- */
.nav-search-container.expanded {
  position: absolute;
  left: 8px;
  right: 8px;
  width: calc(100% - 16px);
  height: 38px;
  background-color: #0b0d10;
  border: 1px solid var(--accent);
  border-radius: 9999px;
  padding: 3px 3px 3px 16px;
  z-index: 105;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  margin: 0;
  min-width: 0;
  overflow: visible;
  cursor: default;
  flex-shrink: 0;
}

.nav-search-container.expanded .nav-search-input {
  width: calc(100% - 40px);
  opacity: 1;
  pointer-events: auto;
  padding: 6px 0;
}

.nav-search-container.expanded .nav-search-btn {
  position: relative;
  right: auto;
  top: auto;
  background-color: #1f242c;
}

.mobile-subbar {
  position: sticky;
  top: var(--navbar-height, 51px);
  display: none; /* Controlled dynamically by JS */
  justify-content: flex-end;
  align-items: center;
  padding: 8px 16px;
  background-color: rgba(13, 17, 23, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  z-index: 99;
  will-change: transform;
}

.mobile-subbar-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.mobile-subbar .nav-download-btn,
.mobile-subbar .nav-refresh-btn,
.mobile-subbar .nav-github-link,
.mobile-subbar .version-selector {
  display: flex;
}

/* --- Mobile Responsive Collapsible Navbar Layout --- */
@media (max-width: 493px) {
  .navbar {
    padding: 10px 12px;
  }

  .nav-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    width: 100%;
    position: relative;
  }

  .logo-svg {
    width: 28px !important;
    height: 24px !important;
  }

  .nav-logo-text {
    display: block !important;
    font-size: 1.05rem !important;
  }

  .nav-toolbar {
    gap: 8px !important;
  }

  /* Hide original Version selector and GitHub icon from the main navbar on mobile */
  .navbar .nav-github-link,
  .navbar .version-selector {
    display: none !important;
  }

  /* Force search pill mode to occupy all middle space on mobile */
  .nav-search-container.search-pill-mode {
    margin: 0 8px !important;
    flex-grow: 1;
    max-width: 341px !important;
    height: 32px !important;
  }

  /* Secondary mobile subbar layout */
  .mobile-subbar {
    position: sticky !important;
    top: var(--navbar-height, 51px) !important;
    z-index: 99;
    will-change: transform;
  }

  .mobile-subbar .version-select {
    font-size: 0.6rem !important;
    padding: 4px 15px 4px 6px !important;
    background-position: right 4px center !important;
  }

  .mobile-subbar .nav-github-link svg,
  .mobile-subbar .nav-refresh-btn svg,
  .mobile-subbar .nav-download-btn svg {
    width: 18px !important;
    height: 18px !important;
  }
}

/* --- Smart Search Helper Text Styling --- */
.search-helper {
  background-color: rgba(74, 144, 217, 0.06);
  border: 1px solid rgba(74, 144, 217, 0.2);
  border-radius: var(--border-radius);
  padding: 10px 16px;
  margin: 0 auto 16px auto;
  max-width: 1200px;
  width: calc(100% - 32px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-primary);
  animation: fadeIn var(--transition-speed) var(--transition-ease);
}

.search-helper-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
  border: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
  transition: color 0.2s ease;
}

.search-helper-link:hover {
  color: #60a5fa;
}

/* --- Footer Styling --- */
.app-footer {
  border-top: 1px solid var(--card-border);
  padding: 24px 16px;
  margin-top: 48px;
  background-color: rgba(13, 17, 23, 0.4);
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.footer-links {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.footer-links a:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.footer-bullet {
  color: #30363d;
}

.footer-privacy {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.85;
}

/* --- Tracker Type Segmented Control --- */
.tracker-type-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  margin-top: 8px;
}

.tracker-type-selector input[type="radio"] {
  display: none;
}

.tracker-type-selector label.type-tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tracker-type-selector label.type-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.tracker-type-selector input[type="radio"]:checked+label.type-tab {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* --- Checklist Builder in Modals --- */
.checklist-builder-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.checklist-builder-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.checklist-builder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 8px 12px;
  gap: 8px;
}

.checklist-builder-item .item-text-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.92rem;
  flex: 1;
  outline: none;
  padding: 2px 0;
}

.checklist-builder-item .item-text-input:focus {
  border-bottom: 1px solid var(--accent);
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.btn-remove-item:hover {
  transform: scale(1.15);
}

.btn-reorder-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: grab;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.btn-reorder-item:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.btn-reorder-item:active {
  cursor: grabbing;
}

.checklist-builder-item.dragging {
  opacity: 0.5;
  border-style: dashed;
  border-color: var(--accent);
  background: rgba(74, 144, 217, 0.05);
}

/* --- Card Checklist styles --- */
.card-checklist-container {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.35s ease;
  flex-grow: 1;
}

.card-progress.expanded .card-checklist-container {
  max-height: 1000px;
}

.card-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.card-checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--success);
  cursor: pointer;
}

.card-checklist-item.done {
  color: var(--text-muted);
  opacity: 0.6;
}

.card-checklist-item.done .checklist-item-text {
  text-decoration: line-through;
}

.checklist-summary-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Card Note styles --- */
.card-note-text {
  font-size: 0.92rem;
  line-height: 1.38;
  color: #c9d1d9;
  margin-top: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 96px;
  /* 4 lines approx */
  transition: max-height 0.35s ease;
  flex-grow: 1;
}

.card-progress.expanded .card-note-text {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  max-height: 2000px;
}

.show-more-indicator {
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 6px;
  cursor: pointer;
  font-weight: 600;
  display: inline-block;
  user-select: none;
}

.card-progress.expanded .show-more-indicator {
  display: none;
}

.show-less-indicator {
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 6px;
  cursor: pointer;
  font-weight: 600;
  display: none;
  user-select: none;
}

.card-progress.expanded .show-less-indicator {
  display: inline-block;
}

/* --- Update Modal Checklist List --- */
.update-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 2px 4px;
}

.update-checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.update-checklist-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--card-border);
}

.update-checklist-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--success);
  cursor: pointer;
}

.update-checklist-row.done {
  color: var(--text-muted);
}

.update-checklist-row.done .update-checklist-text {
  text-decoration: line-through;
}

/* --- Card clickable styling --- */
.card-progress {
  cursor: pointer;
}

.card-progress.expanded {
  height: auto !important;
  min-height: 180px;
}

/* --- Section Divider --- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #444C56;
  font-size: 11px;
  margin: 20px 0 15px 0;
}

.section-divider hr {
  flex: 1;
  border: none;
  height: 1px;
  background: #30363D;
  margin: 0;
}

.section-divider span {
  padding: 0 4px;
}

/* --- Notification Settings Panel inside Deadline Box --- */
.notification-section {
  margin-top: 10px;
  transition: opacity 0.2s ease;
}

.notify-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.notify-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #21262d;
  border: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
  transition: transform 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked+.toggle-slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateY(-50%) translateX(20px);
}

/* Collapsible Settings Content */
.notify-settings-content {
  max-height: 500px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.2s ease;
  margin-top: 10px;
}

.notify-settings-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

/* Mode input sections */
.notify-mode-a,
.notify-mode-b {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.notify-sub-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notify-inputs-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
}

.notify-mode-a-inputs,
.notify-mode-b-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notify-mode-a-inputs .form-input,
.notify-mode-b-inputs .form-input {
  text-align: center;
  padding: 6px;
  font-size: 0.85rem;
}

/* Input compact widths */
#notify-hrs,
#notify-mins,
#edit-notify-hrs,
#edit-notify-mins {
  max-width: 70px;
}

#notify-percent,
#edit-notify-percent {
  max-width: 60px;
}

.notify-sep,
.notify-suffix,
.notify-prefix {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Or Divider */
.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #444C56;
  font-size: 11px;
  margin: 12px 0;
}

.or-divider hr {
  flex: 1;
  border: none;
  height: 1px;
  background: #30363D;
}

.or-divider span {
  padding: 0 4px;
}

/* Preview Line */
.notify-preview {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  display: none;
}

.notify-preview.visible {
  display: block;
}

.notify-preview.valid {
  background: rgba(46, 160, 67, 0.15);
  border: 1px solid rgba(46, 160, 67, 0.3);
  color: #56D364;
  /* Vibrant green */
}

.notify-preview.invalid {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: #FF7B72;
  /* Error red */
}

/* End Alert Row */
.end-alert-row {
  margin-top: 5px;
  margin-bottom: 10px;
  padding-left: 12px;
}

.notify-divider {
  border: none;
  border-top: 1px solid #30363D;
  margin: 4px 0 14px 0;
}

.end-alert-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.end-alert-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent);
}

/* Spinner overrides for compact number inputs */
.notify-input::-webkit-inner-spin-button,
.notify-input::-webkit-outer-spin-button {
  display: none;
}

.notify-input {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Textarea Footer & Character Counter */
.textarea-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

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


.card-note-text .note-h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 12px 0 6px 0;
  color: var(--text-primary);
}

.card-note-text .note-h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 10px 0 4px 0;
  color: var(--text-primary);
}

.card-note-text .note-h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 8px 0 2px 0;
  color: var(--text-primary);
}

.card-note-text .note-ul,
.card-note-text .note-ol {
  margin: 0;
  padding-left: 20px;
}

.card-note-text .note-ul {
  list-style-type: disc;
}

.card-note-text .note-ol {
  list-style-type: decimal;
}

.card-note-text .note-li {
  margin-bottom: 0px;
  font-size: 0.92rem;
  line-height: 1.38;
}

.card-note-text .note-code {
  background-color: #21262d;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

.card-note-text .note-code-block {
  background-color: #161b22;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow-x: auto;
  margin: 8px 0;
}

.card-note-text .note-code-block code {
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  font-size: 0.85rem;
  color: #e6edf3;
}

.card-note-text .note-p {
  margin-bottom: 0px;
}



.controls-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* APK Download Button */
.btn-apk-download {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  color: #4ADE80;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.05);
}

.btn-apk-download:hover {
  background-color: rgba(74, 222, 128, 0.2);
  border-color: #4ADE80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.2);
  transform: translateY(-1px);
}

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

.apk-icon {
  flex-shrink: 0;
}

/* Shake Animation */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  15%,
  45%,
  75% {
    transform: translateX(-4px);
  }

  30%,
  60% {
    transform: translateX(4px);
  }
}

.shake-anim {
  animation: shake 0.4s ease;
}

/* Edit Mode Button */
.btn-toggle-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-toggle-edit:hover {
  border-color: var(--accent);
  background-color: rgba(56, 189, 248, 0.1);
  transform: translateY(-1px);
}

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

.btn-toggle-edit.active {
  border-color: var(--accent);
  background-color: var(--accent);
  color: #000;
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-toggle-edit.active svg {
  stroke: #000;
}

/* Delete Selected Button */
.btn-delete-selected {
  display: none;
  /* Hidden by default, shown via edit-active swap */
  align-items: center;
  background-color: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
  color: #FF7B72;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 38px;
}

.btn-delete-selected:hover {
  background-color: #f85149;
  color: #fff;
  border-color: #f85149;
  transform: translateY(-1px);
}

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

/* Swap Sort selector with Bulk Delete button in Edit Mode */
.dashboard-controls.edit-active .sort-container {
  display: none !important;
}

.dashboard-controls.edit-active .btn-delete-selected {
  display: flex !important;
}

/* Card Selection styling (circle hidden per user request, using selection border instead) */
.card-select-control {
  display: none !important;
}

.card-progress.selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent), 0 0 20px var(--accent-glow) !important;
}

/* Edit Mode grid active state rules */
.cards-grid.edit-mode .card-actions {
  display: none !important;
}

.cards-grid.edit-mode .card-progress {
  user-select: none;
}

.cards-grid.edit-mode .card-progress:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* If grid has selections, dim all non-selected cards to make selected ones stand out */
.cards-grid.edit-mode.has-selections .card-progress:not(.selected) {
  opacity: 0.45;
  transform: none !important;
  /* disable lift translation */
  box-shadow: none !important;
  border-color: var(--card-border) !important;
}

.cards-grid.edit-mode.has-selections .card-progress:not(.selected):hover {
  opacity: 0.75;
  border-color: var(--text-muted) !important;
}

/* Rhythmic loading/refresh spin animation */
.spinning svg {
  animation: rhythmic-spin 1.2s cubic-bezier(0.68, -0.6, 0.32, 1.6) infinite;
}

@keyframes rhythmic-spin {
  0% {
    transform: rotate(0deg);
  }

  30% {
    transform: rotate(120deg);
  }

  40% {
    transform: rotate(110deg);
  }

  75% {
    transform: rotate(300deg);
  }

  85% {
    transform: rotate(290deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* --- Terrace Updates Page Overlay --- */
.terrace-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background-color: rgba(10, 12, 16, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.terrace-overlay.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.terrace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
  background-color: rgba(13, 17, 23, 0.5);
}

.terrace-back-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.terrace-back-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.terrace-back-btn:active {
  transform: scale(0.9);
}

.terrace-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.terrace-title-icon {
  color: var(--accent);
}

.terrace-title-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-family);
  letter-spacing: -0.02em;
}

.terrace-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
}

/* Version log card styling */
.terrace-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  animation: slideUpFade 0.4s var(--transition-ease) both;
}

.terrace-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-border);
}

.terrace-card.latest::before {
  background: var(--accent);
}

.terrace-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--card-border);
  padding-bottom: 12px;
}

.terrace-version-badge {
  background-color: var(--card-border);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.terrace-card.latest .terrace-version-badge {
  background-color: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(0, 168, 204, 0.3);
}

.terrace-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.terrace-version-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0 0 0;
  width: 100%;
}

/* Markdown rendered list styling */
.terrace-body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.terrace-body h3 {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin: 16px 0 8px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.terrace-body h3::before {
  content: '▪';
  color: var(--accent);
  font-size: 0.8rem;
}

.terrace-body ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
}

.terrace-body li {
  margin-bottom: 6px;
  list-style-type: disc;
}

.terrace-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}




/* Real-Time Contenteditable Note Editor Styles (v4.0) */
.note-editor-contenteditable {
  margin: 0 !important;
  width: 100% !important;
  height: 405px !important;
  min-height: 405px !important;
  max-height: 405px !important;
  font-family: var(--font-family) !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  padding: 10px 14px !important;
  box-sizing: border-box !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  overflow-y: auto !important;
  outline: none !important;
  background-color: rgba(13, 17, 23, 0.6) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 8px !important;
  user-select: text !important;
}

.note-editor-contenteditable:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

/* Placeholder for contenteditable */
.note-editor-contenteditable:empty::before {
  content: attr(placeholder);
  color: var(--text-muted);
  pointer-events: none;
  display: block;
}

/* Contenteditable Line Block Elements styling */
.note-editor-contenteditable div {
  margin: 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  display: block;
}

/* Bullet Line Indent & Marker */
.note-editor-contenteditable .note-line-bullet {
  position: relative;
  padding-left: 20px !important;
  text-indent: 0 !important;
  margin-bottom: 4px;
}
.note-editor-contenteditable .note-line-bullet::before {
  content: "●";
  position: absolute;
  left: 4px;
  color: rgba(139, 148, 158, 0.6);
  font-size: 0.75rem;
  line-height: 2.1;
  pointer-events: none;
  user-select: none;
}

/* Numbered Line Indent & Marker */
.note-editor-contenteditable .note-line-number {
  position: relative;
  padding-left: 24px !important;
  text-indent: 0 !important;
  margin-bottom: 4px;
}
.note-editor-contenteditable .note-line-number::before {
  content: attr(data-number) ".";
  position: absolute;
  left: 4px;
  color: rgba(139, 148, 158, 0.6);
  pointer-events: none;
  user-select: none;
}

/* Plain Line */
.note-editor-contenteditable .note-p {
  margin-bottom: 4px;
  display: block;
}

/* Markdown Header Elements inside Editor */
.note-editor-contenteditable .note-h1 {
  font-size: 1.4rem !important;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 6px;
  display: block;
}
.note-editor-contenteditable .note-h2 {
  font-size: 1.2rem !important;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 6px;
  display: block;
}
.note-editor-contenteditable .note-h3 {
  font-size: 1.05rem !important;
  font-weight: 700;
  margin-top: 10px;
  margin-bottom: 4px;
  display: block;
}

/* Markdown Inline Syntax Markers (styled low-opacity) */
.note-editor-contenteditable .markdown-syntax {
  color: rgba(139, 148, 158, 0.5) !important;
}

/* Code Styles inside Editor */
.note-editor-contenteditable .note-code {
  background-color: #21262d;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace !important;
}

.note-editor-contenteditable .note-code-block {
  background-color: #161b22;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  overflow-x: auto;
  display: block;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace !important;
  margin-top: 6px;
  margin-bottom: 6px;
}

/* Styling for single-line textareas replacing inputs to suppress Chrome Autofill */
textarea.form-input-single-line {
  resize: none !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  line-height: 24px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

/* Floating Action Button (FAB) */
.btn-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(22, 27, 34, 0.5) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #3F85F6;
  border: 1.5px solid rgba(63, 133, 246, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  z-index: 999;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border-color 0.25s ease, color 0.25s, opacity 0.2s, visibility 0.2s;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  padding: 0;
}

.btn-fab:hover {
  transform: scale(1.08);
  border-color: #3F85F6;
  background: rgba(63, 133, 246, 0.15) !important;
  box-shadow: 0 12px 40px rgba(63, 133, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-fab:active {
  transform: scale(0.95);
}

.btn-fab.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.btn-fab svg {
  display: block;
  pointer-events: none;
  stroke: #3F85F6;
  transition: transform 0.25s ease;
}

.btn-fab:hover svg {
  transform: rotate(90deg);
}

/* On mobile, keep it slightly smaller and shifted */
@media (max-width: 493px) {
  .btn-fab {
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
  }
}

/* Search highlight style */
.search-highlight {
  background-color: rgba(243, 156, 18, 0.25);
  color: #F39C12;
  border-radius: 3px;
  padding: 0px 2px;
  font-weight: 500;
}

/* Formatting popover styling */
.formatting-popover {
  position: fixed; /* view-relative to prevent clipping */
  margin-top: 6px;
  background-color: #161B22;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 8px 10px;
  max-width: 240px;
  width: max-content;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  font-weight: normal;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: left;
  cursor: default;
  color: #c9d1d9;
}

.formatting-popover.hidden {
  display: none !important;
}

.formatting-popover ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.formatting-popover li {
  margin-bottom: 4px;
  padding-right: 12px; /* make space for X button on first lines */
}

.formatting-popover li:last-child {
  margin-bottom: 0;
}

.formatting-popover .btn-close-popover {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.formatting-popover .btn-close-popover:hover {
  color: var(--text-primary);
}