/* LifeOS — Global Design System (Premium) */

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

/* ==================== CSS VARIABLES ==================== */
:root {
  --primary-50: #e5eeee;
  --primary-100: #dbe8e8;
  --primary-200: #cbdcdc;
  --primary-300: #b1cbcb;
  --primary-400: #a4c2c2;
  --primary-500: #97b9b9;
  --primary-600: #8ab3b3;
  --primary-700: #7da8a8;
  --primary-800: #6d9999;
  --primary-900: #5a8a8a;

  --neutral-50: #f8fafa;
  --neutral-100: #eef3f3;
  --neutral-200: #dbe3e3;
  --neutral-300: #b8c4c4;
  --neutral-400: #95a5a5;
  --neutral-500: #708080;
  --neutral-600: #556666;
  --neutral-700: #3d4f4f;
  --neutral-800: #2a3838;
  --neutral-900: #1a2626;

  --shadow-xs: 0 1px 2px rgba(10, 16, 16, 0.04);
  --shadow-sm: 0 1px 3px rgba(10, 16, 16, 0.06), 0 1px 2px rgba(10, 16, 16, 0.04);
  --shadow-md: 0 4px 8px rgba(10, 16, 16, 0.07), 0 2px 4px rgba(10, 16, 16, 0.04);
  --shadow-lg: 0 12px 24px rgba(10, 16, 16, 0.1), 0 4px 8px rgba(10, 16, 16, 0.05);
  --shadow-xl: 0 24px 48px rgba(10, 16, 16, 0.14);
  --shadow-ring: 0 0 0 3px rgba(125, 168, 168, 0.3);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 100px;
}

html,
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--neutral-800);
  background: linear-gradient(145deg, #f0f5f5 0%, #e8efef 50%, #f5f8f8 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== LAYOUT ==================== */

.sidebar {
  display: flex;
  flex-direction: column;
  width: 240px;
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  z-index: 40;
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl), 0 0 0 99vw rgba(0, 0, 0, 0.2);
  }
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 60px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  overflow-y: auto;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* Nav Items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--neutral-500);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: var(--primary-700);
  transition: height 200ms ease;
}

.nav-item:hover {
  background: rgba(125, 168, 168, 0.08);
  color: var(--neutral-700);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(125, 168, 168, 0.12) 0%, rgba(125, 168, 168, 0.06) 100%);
  color: var(--primary-800);
  font-weight: 600;
}

.nav-item.active::before {
  height: 20px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

@media (min-width: 1024px) {
  .view-container {
    padding: 32px 48px;
  }
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  align-items: center;
  justify-content: space-around;
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

@media (max-width: 1023px) {
  .mobile-nav {
    display: flex;
  }

  .view-container {
    padding-bottom: 80px;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--neutral-400);
  transition: color 150ms;
  text-decoration: none;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--primary-700);
}

/* ==================== BUTTONS (Premium) ==================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(125, 168, 168, 0.35), var(--shadow-xs);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-900) 100%);
  box-shadow: 0 4px 14px rgba(125, 168, 168, 0.4), var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: var(--shadow-xs);
}

.btn-primary:focus {
  outline: none;
  box-shadow: var(--shadow-ring), 0 2px 8px rgba(125, 168, 168, 0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  background: rgba(125, 168, 168, 0.08);
  color: var(--primary-800);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(125, 168, 168, 0.2);
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  transition: all 180ms ease;
  line-height: 1;
}

.btn-secondary:hover {
  background: rgba(125, 168, 168, 0.14);
  border-color: rgba(125, 168, 168, 0.3);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.97);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--neutral-500);
  font-weight: 500;
  font-size: 13px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
  line-height: 1;
}

.btn-ghost:hover {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.btn-ghost:active {
  transform: scale(0.97);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  transition: all 180ms ease;
  line-height: 1;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0) scale(0.97);
}

.btn-sm {
  padding: 7px 16px;
  font-size: 12px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--neutral-400);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 150ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

/* ==================== FORM INPUTS ==================== */
.input,
.select,
textarea.input {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
  background: #fff;
  color: var(--neutral-900);
  transition: all 180ms ease;
  outline: none;
  box-sizing: border-box;
}

.input::placeholder {
  color: var(--neutral-400);
}

.input:hover {
  border-color: var(--neutral-300);
}

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

.select {
  appearance: none;
  cursor: pointer;
  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='%23708080' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-600);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* ==================== CARDS ==================== */
.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(125, 168, 168, 0.25);
  background: rgba(255, 255, 255, 0.95);
}

.stat-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-600), var(--primary-400));
  opacity: 0.7;
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.badge svg {
  width: 12px;
  height: 12px;
}

.badge-next {
  background: var(--primary-100);
  color: var(--primary-900);
}

.badge-active {
  background: #eff6ff;
  color: #2563eb;
}

.badge-done {
  background: #f0fdf4;
  color: #16a34a;
}

.badge-blocked {
  background: #fef2f2;
  color: #dc2626;
}

.badge-paused {
  background: #fffbeb;
  color: #d97706;
}

.badge-planned {
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.priority-critical {
  color: #dc2626;
}

.priority-high {
  color: #ea580c;
}

.priority-low {
  color: var(--neutral-400);
}

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
  height: 6px;
  background: var(--neutral-200);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-700), var(--primary-400));
  border-radius: 100px;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== TABLE ==================== */
.data-table {
  width: 100%;
  font-size: 13.5px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
  position: sticky;
  top: 0;
}

.data-table tbody tr {
  transition: background 150ms;
}

.data-table tbody tr:hover {
  background: rgba(125, 168, 168, 0.04);
}

.data-table tbody td {
  padding: 12px 14px;
  color: var(--neutral-800);
  border-bottom: 1px solid var(--neutral-100);
}

/* ==================== CHECKBOX ==================== */
.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--neutral-300);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.task-checkbox:hover {
  border-color: var(--primary-500);
  background: var(--primary-50);
}

.task-checkbox.checked {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-600));
  border-color: var(--primary-700);
  box-shadow: 0 2px 6px rgba(125, 168, 168, 0.3);
}

/* ==================== TABS ==================== */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--neutral-100);
  border-radius: var(--radius-pill);
}

.tab-item {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--neutral-500);
  cursor: pointer;
  transition: all 180ms ease;
  border: none;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;
}

.tab-item:hover {
  color: var(--neutral-700);
}

.tab-item.active {
  background: #fff;
  color: var(--primary-800);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ==================== FILTER BAR ==================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-select {
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid var(--neutral-200);
  background: #fff;
  color: var(--neutral-700);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23708080' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all 150ms ease;
}

.filter-select:hover {
  border-color: var(--neutral-300);
}

.filter-select:focus {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-ring);
}

.filter-search {
  padding: 6px 12px 6px 32px;
  font-size: 12px;
  font-family: inherit;
  border-radius: var(--radius-pill);
  border: 1px solid var(--neutral-200);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2395a5a5' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") 10px center no-repeat;
  color: var(--neutral-700);
  outline: none;
  transition: all 150ms ease;
  min-width: 160px;
}

.filter-search::placeholder {
  color: var(--neutral-400);
}

.filter-search:focus {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-ring);
}

/* ==================== MODAL ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  animation: fade-in 200ms ease-out;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 520px;
  margin: 0 16px;
  animation: scale-in 250ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--neutral-100);
  background: var(--neutral-50);
}

/* ==================== TOAST ==================== */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  animation: slide-up 300ms cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 220px;
}

.toast-success {
  background: #fff;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.toast-error {
  background: #fff;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.toast-info {
  background: #fff;
  border: 1px solid var(--primary-200);
  color: var(--primary-900);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }

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

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

@keyframes pulse-soft {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ==================== UTILITIES ==================== */
.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--neutral-900);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

@media (min-width: 1024px) {
  .page-title {
    font-size: 28px;
  }
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 16px;
  text-align: center;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  color: var(--neutral-300);
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral-600);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--neutral-400);
  margin-bottom: 16px;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

.cat-chevron {
  transition: transform 200ms ease;
}

.rotate-180 {
  transform: rotate(180deg);
}

.line-clamp-1,
.line-clamp-2,
.line-clamp-3,
.line-clamp-4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-clamp: 1;
  /* Added standard property */
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skeleton {
  background: var(--neutral-200);
  border-radius: var(--radius-md);
  animation: pulse-soft 1.5s infinite;
}

/* ==================== DARK MODE ==================== */
html.dark body {
  background: linear-gradient(145deg, #0a1212, #0f1717, #0a1212);
  color: #e5eeee;
}

html.dark .sidebar {
  background: rgba(20, 30, 30, 0.92);
  border-color: rgba(255, 255, 255, 0.04);
}

html.dark .topbar {
  background: rgba(20, 30, 30, 0.8);
  border-color: rgba(255, 255, 255, 0.04);
}

html.dark .mobile-nav {
  background: rgba(20, 30, 30, 0.92);
  border-color: rgba(255, 255, 255, 0.04);
}

html.dark .card,
html.dark .card-hover,
html.dark .stat-card {
  background: rgba(26, 36, 36, 0.85);
  border-color: rgba(255, 255, 255, 0.06);
}

html.dark .modal-box {
  background: #1a2424;
  border-color: rgba(255, 255, 255, 0.06);
}

html.dark .toast {
  background: #1a2424;
}

html.dark .nav-item {
  color: #95a5a5;
}

html.dark .nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e5eeee;
}

html.dark .nav-item.active {
  background: rgba(125, 168, 168, 0.12);
  color: var(--primary-400);
}

html.dark .input,
html.dark .select,
html.dark textarea.input {
  background: #1a2424;
  border-color: #2a3838;
  color: #e5eeee;
}

html.dark .page-title {
  color: #e5eeee;
}

html.dark .modal-footer {
  background: #0f1717;
}

html.dark .data-table thead th {
  background: #0f1717;
  border-color: #2a3838;
}

html.dark .data-table tbody tr:hover {
  background: rgba(125, 168, 168, 0.06);
}

html.dark .tab-bar {
  background: rgba(255, 255, 255, 0.04);
}

html.dark .tab-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-400);
}

html.dark .filter-select,
html.dark .filter-search {
  background: #1a2424;
  border-color: #2a3838;
  color: #e5eeee;
}

/* ==================== ENHANCED SELECT STYLING ==================== */
.select,
.filter-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  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='%23708080' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  line-height: 1.4;
}

.select:focus,
.filter-select:focus {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-ring);
}

/* ==================== LOCK SCREEN ==================== */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(145deg, #1a2e2e 0%, #0f1a1a 50%, #162626 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

#lock-screen.hidden {
  display: none;
}

.lock-container {
  width: 100%;
  max-width: 380px;
  padding: 24px;
  text-align: center;
}

.lock-logo {
  margin-bottom: 40px;
}

.lock-logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 32px rgba(125, 168, 168, 0.3);
  animation: lockPulse 3s ease-in-out infinite;
}

@keyframes lockPulse {

  0%,
  100% {
    box-shadow: 0 8px 32px rgba(125, 168, 168, 0.3);
  }

  50% {
    box-shadow: 0 8px 48px rgba(125, 168, 168, 0.5);
  }
}

.lock-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.lock-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
}

.lock-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lock-label {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lock-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  outline: none;
  transition: all 200ms ease;
  text-align: center;
  letter-spacing: 0.15em;
}

.lock-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.lock-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(125, 168, 168, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.lock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
  color: #fff;
  cursor: pointer;
  transition: all 200ms ease;
  margin-top: 4px;
}

.lock-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(125, 168, 168, 0.4);
}

.lock-btn:active {
  transform: scale(0.98);
}

.lock-error {
  font-size: 13px;
  color: #f87171;
  padding: 8px;
  border-radius: var(--radius-md);
  background: rgba(248, 113, 113, 0.1);
}

.lock-error.hidden {
  display: none;
}

.lock-text-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 8px;
  transition: color 150ms;
}

.lock-text-btn:hover {
  color: rgba(255, 255, 255, 0.6);
}

.lock-footer {
  margin-top: 32px;
}

/* PIN Pad */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  transition: all 200ms ease;
}

.pin-dot.filled {
  background: var(--primary-500);
  border-color: var(--primary-500);
  box-shadow: 0 0 12px rgba(125, 168, 168, 0.5);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 0 auto 16px;
}

.pin-key {
  width: 72px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 150ms ease;
  margin: 0 auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pin-key:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pin-key:active {
  background: rgba(125, 168, 168, 0.2);
  transform: scale(0.95);
}

.pin-key.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.pin-key.del {
  color: rgba(255, 255, 255, 0.5);
}

/* Biometric button */
.lock-biometric-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
  margin: 0 auto 12px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 200ms ease;
}

.lock-biometric-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

@keyframes shake {

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

  20% {
    transform: translateX(-10px);
  }

  40% {
    transform: translateX(10px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(6px);
  }
}

/* ==================== NOTIFICATION PANEL ==================== */
.notif-panel {
  position: fixed;
  top: 52px;
  right: 12px;
  width: 340px;
  max-height: 420px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-xl);
  z-index: 999;
  overflow: hidden;
  animation: slideDown 200ms ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.notif-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--neutral-900);
}

.notif-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background 150ms ease;
  cursor: pointer;
}

.notif-item:hover {
  background: rgba(125, 168, 168, 0.06);
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.notif-dot.overdue {
  background: #ef4444;
}

.notif-dot.due {
  background: #f59e0b;
}

.notif-dot.info {
  background: var(--primary-600);
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-800);
  line-height: 1.4;
}

.notif-item-sub {
  font-size: 11px;
  color: var(--neutral-400);
  margin-top: 2px;
}

.notif-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--neutral-400);
  font-size: 13px;
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 100px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

html.dark .notif-panel {
  background: rgba(26, 36, 36, 0.98);
  border-color: rgba(255, 255, 255, 0.08);
}

html.dark .notif-header {
  border-color: rgba(255, 255, 255, 0.06);
}

html.dark .notif-header h3 {
  color: #e5eeee;
}

html.dark .notif-item-title {
  color: #e5eeee;
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 640px) {

  /* Page titles & header rows: stack vertically */
  .page-title {
    font-size: 22px;
  }

  /* Stat cards: tighter padding */
  .stat-card {
    padding: 14px;
  }

  .stat-card .text-2xl {
    font-size: 1.25rem;
  }

  /* Cards */
  .card {
    padding: 16px;
  }

  /* Quick-add row: stack on mobile */
  .daily-quick-add {
    flex-wrap: wrap;
  }

  .daily-quick-add .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* Tab bar: tighter on mobile */
  .tab-bar {
    gap: 2px;
    padding: 3px;
  }

  .tab-item {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  /* Filter bar: horizontal scroll with smaller items */
  .filter-bar {
    gap: 6px;
  }

  .filter-search {
    min-width: 120px;
    flex-shrink: 0;
  }

  .filter-select {
    flex-shrink: 0;
    min-width: 0;
    max-width: 140px;
  }

  /* Modal: full width on mobile */
  .modal-box {
    width: 95% !important;
    max-width: 95% !important;
    margin: 16px auto;
    max-height: 90vh;
  }

  .modal-body {
    max-height: 65vh;
    overflow-y: auto;
  }

  /* Notification panel: fixed to viewport on mobile */
  .notif-panel {
    position: fixed;
    top: 52px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  /* Topbar */
  .topbar {
    padding: 0 12px;
    height: 48px;
  }

  /* View container */
  .view-container {
    padding: 16px 12px 80px;
  }
}