/* DESIGN SYSTEM & CSS VARIABLES */
:root {
  --font-family: 'Outfit', sans-serif;
  
  /* Color Palette (Black & White Theme) */
  --bg-app: #F4F4F5;          /* Zinc 100 - soft off-white background */
  --bg-card: #FFFFFF;         /* Pure White for list containers */
  --bg-card-border: #E4E4E7;  /* Zinc 200 - thin borders */
  --bg-divider: #F4F4F5;      /* Zinc 100 - list separators */
  
  --text-primary: #09090B;    /* Zinc 950 - rich black */
  --text-secondary: #71717A;  /* Zinc 500 - muted gray */
  --text-muted: #A1A1AA;      /* Zinc 400 - light gray */
  
  --primary-accent: #09090B;  /* Zinc 950 - solid black */
  --primary-hover: #27272A;   /* Zinc 800 */
  --primary-accent-light: #F4F4F5; /* Zinc 100 - active nav pill background */
  
  /* Summary Card Gradient */
  --summary-gradient: linear-gradient(135deg, #27272A, #09090B); /* Deep zinc gradient */
  --summary-ring-bg: rgba(255, 255, 255, 0.15);
  --summary-ring-bar: #FFFFFF;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-fab: 0 10px 20px rgba(0, 0, 0, 0.25);
  --shadow-phone: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* RESET & BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-family);
  background-color: #E4E4E7; /* Outer page background (desktop context) */
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

/* SPLASH SCREEN FULLSCREEN ANIMATED CONTAINER */
.splash-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #FFFFFF;
  z-index: 2000; /* topmost layer */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease;
}

.splash-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.splash-logo {
  font-family: var(--font-family);
  font-size: 42px;
  font-weight: 800;
  color: #000000;
  letter-spacing: 2px;
  opacity: 0;
  transform: scale(0.96);
  animation: logoFadeIn 1.2s cubic-bezier(0.25, 1, 0.5, 1) 0.1s forwards;
}

@keyframes logoFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.96);
    letter-spacing: 2px;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    letter-spacing: 12px;
  }
}

.splash-loader-bar {
  width: 120px;
  height: 2px;
  background-color: var(--bg-card-border);
  border-radius: 1px;
  overflow: hidden;
}

.splash-loader-fill {
  height: 100%;
  background-color: var(--primary-accent);
  width: 0%;
  animation: loaderFill 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes loaderFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* SPLASH SCREEN TRANSITION OUT */
.splash-screen.exit {
  transform: translateY(-30px);
  opacity: 0;
  pointer-events: none;
}

/* APP WRAPPER & PHONE FRAME */
.app-wrapper {
  width: 100%;
  max-width: 450px;
  height: 100vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
}

.phone-container {
  background-color: var(--bg-app);
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-phone);
}

@media (min-width: 451px) {
  .phone-container {
    border-radius: 40px;
    border: 10px solid #18181B; /* Simulated phone bezel */
    height: 95vh;
  }
}

/* TOP STATUS BAR */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px 4px;
  background-color: var(--bg-app);
  font-size: 14px;
  font-weight: 600;
  z-index: 10;
}

.status-bar .icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* APP CONTENT MAIN CONTAINER */
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 85px; /* bottom padding accounts for navigation bar */
  overflow-y: auto;
  scrollbar-width: none;
}

.app-content::-webkit-scrollbar {
  display: none;
}

/* HEADER SECTION */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  margin-top: 10px;
}

.user-info .greeting {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.user-info .greeting .editable-name {
  border-bottom: 2px dashed var(--text-muted);
  outline: none;
  cursor: pointer;
  padding: 0 4px;
  transition: all 0.2s ease;
}

.user-info .greeting .editable-name:focus {
  border-bottom-style: solid;
  border-bottom-color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.user-info .date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* HEADER ACTION BUTTONS */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.header-action-btn:hover {
  background-color: var(--primary-accent-light);
  color: var(--text-primary);
}

.avatar-container {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--bg-card-border);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.avatar-container:hover {
  transform: scale(1.05);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* SUMMARY CARD */
.summary-card {
  background: var(--summary-gradient);
  border-radius: 24px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #FFFFFF;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.summary-left {
  flex-shrink: 0;
}

.progress-ring-container {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ring-svg {
  transform: rotate(-90deg);
}

.ring-bg {
  fill: transparent;
  stroke: var(--summary-ring-bg);
  stroke-width: 6px;
}

.ring-bar {
  fill: transparent;
  stroke: var(--summary-ring-bar);
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-dasharray: 201.06;
  stroke-dashoffset: 201.06; /* Initial empty */
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text-center {
  position: absolute;
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.5px;
}

.summary-right {
  flex: 1;
}

.summary-message {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.95);
}

.stats-grid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat-col {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
}

.stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* LIST SECTIONS */
.list-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.toggle-completed-btn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.toggle-completed-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.toggle-completed-btn .icon {
  display: flex;
  align-items: center;
}

/* ITEMS CONTAINER CARD */
.items-card {
  background-color: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bg-card-border);
}

.list-container {
  position: relative;
}

/* LIST ITEM ELEMENT */
.todo-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-divider);
  transition: background-color 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

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

.todo-item:active {
  background-color: rgba(0, 0, 0, 0.01);
}

/* CUSTOM CHECKBOX CONTAINER */
.todo-checkbox-wrapper {
  margin-right: 16px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.todo-checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.todo-checkbox-custom {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover checked states */
.todo-checkbox-wrapper:hover .todo-checkbox-custom {
  border-color: var(--text-primary);
}

/* Checked styling */
.todo-item.completed .todo-checkbox-custom {
  background-color: var(--primary-accent);
  border-color: var(--primary-accent);
  transform: scale(1.05);
}

.todo-checkbox-custom svg {
  width: 12px;
  height: 12px;
  color: #FFFFFF;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.todo-item.completed .todo-checkbox-custom svg {
  opacity: 1;
  transform: scale(1);
}

/* Text styling */
.todo-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.25s ease;
  flex: 1;
  word-break: break-word;
}

.todo-item.completed .todo-title {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Slide animation for items collapsing/entering */
@keyframes itemCollapse {
  to {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    opacity: 0;
    transform: translateY(-10px);
  }
}

.todo-item.collapsing {
  animation: itemCollapse 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* EMPTY STATES */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  background-color: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bg-card-border);
  animation: fadeIn 0.4s ease-out;
}

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

.empty-illustration {
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
}

.empty-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* TAB VIEWS CONTROLS */
.tab-view {
  display: none;
  animation: viewFadeIn 0.3s ease-out;
}

.tab-view.active {
  display: block;
}

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

/* BUDGET VIEW SPECIFIC STYLES */
.balance-card {
  background: var(--summary-gradient);
  border-radius: 24px;
  padding: 24px;
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.balance-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-row {
  display: flex;
  align-items: baseline;
  margin-top: 6px;
  margin-bottom: 4px;
}

.balance-currency {
  font-size: 28px;
  font-weight: 500;
  margin-right: 4px;
}

.balance-amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  outline: none;
}

.balance-amount:focus {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0 4px;
}

.balance-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.limit-card {
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.limit-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.limit-progress-bar {
  height: 8px;
  background-color: var(--bg-app);
  border-radius: 4px;
  overflow: hidden;
}

.limit-progress-fill {
  height: 100%;
  background-color: var(--primary-accent);
  width: 0%;
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.limit-progress-fill.warning {
  background-color: #555555;
}

.limit-progress-fill.danger {
  background-color: #000000;
}

/* TRANSACTIONS ITEM ELEMENT */
.tx-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-divider);
  transition: background-color 0.2s ease;
}

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

.tx-icon-container {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.tx-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tx-desc {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-cat {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tx-financial-info {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.tx-amt {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.tx-amt.expense {
  color: #000000;
}

.tx-amt.expense::before {
  content: "- ₹";
}

.tx-amt.income {
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tx-amt.income::before {
  content: "+ ₹";
}

.tx-method {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.tx-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 0 0 14px;
  line-height: 1;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.tx-delete-btn:hover {
  color: #000000;
}

/* TRANSACTION FIELDS FOR BOTTOM SHEET */
.form-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.flex-1 {
  flex: 1;
}

.tx-type-options {
  display: flex;
  gap: 4px;
  background-color: var(--bg-app);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--bg-card-border);
}

.tx-type-btn {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tx-type-btn.active {
  background-color: #FFFFFF;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.tx-source-options {
  display: flex;
  gap: 8px;
}

.source-badge {
  background-color: var(--bg-app);
  color: var(--text-secondary);
  border: 1.5px solid var(--bg-card-border);
  padding: 9px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}

.source-badge.active {
  background-color: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
}

.custom-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--bg-card-border);
  font-family: var(--font-family);
  font-size: 15px;
  outline: none;
  background-color: var(--bg-app);
  color: var(--text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  cursor: pointer;
}

/* DIARY WORKSPACE STYLING */
.diary-mode-toggles {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  align-items: center;
}

.diary-toggle-btn {
  flex: 1;
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.diary-toggle-btn.active {
  background-color: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
}

.diary-settings-btn {
  width: 38px;
  height: 38px;
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.diary-settings-btn:hover {
  background-color: var(--bg-card-border);
  color: var(--text-primary);
}

.diary-panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.diary-panel.active {
  display: block;
}

.editor-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.diary-panel input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--bg-card-border);
  font-family: var(--font-family);
  font-size: 15px;
  outline: none;
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  transition: border-color 0.2s ease;
}

.diary-panel input[type="text"]:focus {
  border-color: var(--text-primary);
}

.diary-panel textarea {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: 1.5px solid var(--bg-card-border);
  font-family: var(--font-family);
  font-size: 15px;
  outline: none;
  background-color: var(--bg-card);
  color: var(--text-primary);
  resize: none;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

.diary-panel textarea:focus {
  border-color: var(--text-primary);
}

.mood-selector-container {
  display: flex;
  justify-content: space-between;
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 8px;
  gap: 6px;
}

.mood-btn {
  flex: 1;
  font-size: 24px;
  padding: 6px 0;
  text-align: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  filter: grayscale(100%);
  opacity: 0.6;
}

.mood-btn:hover {
  background-color: var(--bg-app);
  filter: grayscale(0%);
  opacity: 1;
}

.mood-btn.active {
  background-color: var(--bg-app);
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}

/* DIARY ENTRIES FEED & LIST */
.diary-entries-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: none;
}

.diary-entries-feed::-webkit-scrollbar {
  display: none;
}

.diary-card-item {
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

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

.diary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.diary-card-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.diary-card-mood {
  font-size: 18px;
}

.diary-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 24px;
}

.diary-card-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diary-card-delete {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.diary-card-delete:hover {
  color: #000000;
}

/* SECURE LOCK LAYER OVERLAY */
.diary-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-app);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lock-header {
  text-align: center;
  margin-bottom: 24px;
}

.lock-icon {
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.lock-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.lock-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.lock-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.lock-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-primary);
  background-color: transparent;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.lock-dots .dot.filled {
  background-color: var(--text-primary);
  transform: scale(1.15);
}

.lock-dots.shake {
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.lock-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 240px;
}

.keypad-key {
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  font-family: var(--font-family);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.keypad-key:active {
  background-color: var(--bg-card-border);
  transform: scale(0.92);
}

.keypad-key.cmd {
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: 0;
}

.keypad-key.cmd:active {
  background-color: transparent;
  color: var(--text-primary);
}

/* DIARY PIN CONFIG MODAL */
.diary-settings-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 85%;
  max-width: 320px;
  background-color: var(--bg-card);
  border-radius: 28px;
  padding: 20px 24px 28px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.3, 0.8, 0.4, 1.1), opacity 0.3s ease;
}

.diary-settings-modal.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* FOCUS MODAL STYLE IN OVERLAY CONTAINER */
.focus-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 990;
}

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

.focus-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 85%;
  max-width: 340px;
  background-color: var(--bg-card);
  border-radius: 28px;
  padding: 20px 24px 28px;
  box-shadow: var(--shadow-lg);
  z-index: 991;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.3, 0.8, 0.4, 1.1), opacity 0.3s ease;
}

.focus-modal.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

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

.focus-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

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

.focus-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* BOTTOM NAVIGATION */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

/* Add safe-area padding for modern phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    height: calc(76px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app-content {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;
}

.nav-icon-wrapper {
  padding: 6px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active .nav-icon-wrapper {
  background-color: var(--primary-accent-light);
  color: var(--text-primary);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
  transition: color 0.2s ease;
}

.nav-item.active .nav-label {
  color: var(--text-primary);
  font-weight: 700;
}

/* FAB overlapping spacing */
.nav-fab-spacer {
  width: 60px;
  flex-shrink: 0;
}

.fab-btn {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--primary-accent);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1.3);
  z-index: 101;
}

.fab-btn:hover {
  transform: translateX(-50%) scale(1.05);
  background-color: var(--primary-hover);
}

.fab-btn:active {
  transform: translateX(-50%) scale(0.92);
}

/* BOTTOM SHEET DRAWER */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 998;
}

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

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 8px 24px 32px;
  z-index: 999;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.3, 0.8, 0.4, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
}

.bottom-sheet.active {
  transform: translateY(0);
}

/* Handle bar at top of bottom sheet */
.drag-handle {
  width: 36px;
  height: 5px;
  background-color: var(--bg-card-border);
  border-radius: 3px;
  margin: 0 auto 18px;
}

.sheet-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* TOGGLE GROUP TASK VS HABIT VS TX */
.type-toggle-group {
  display: flex;
  background-color: var(--bg-app);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--bg-card-border);
}

.type-toggle-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background-color: transparent;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-toggle-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--bg-card-border);
  font-family: var(--font-family);
  font-size: 15px;
  outline: none;
  background-color: var(--bg-app);
  color: var(--text-primary);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="number"]::placeholder,
.form-group input[type="password"]::placeholder,
.form-group input[type="email"]::placeholder {
  color: var(--text-muted);
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus {
  border-color: var(--text-primary);
  background-color: #FFFFFF;
}

/* HABIT FREQUENCY OPTIONS */
.habit-freq-options {
  display: flex;
  gap: 10px;
}

.freq-badge {
  background-color: var(--bg-app);
  color: var(--text-secondary);
  border: 1.5px solid var(--bg-card-border);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.freq-badge.active {
  background-color: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
}

.sheet-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.sheet-btn {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-cancel {
  background-color: var(--bg-app);
  color: var(--text-secondary);
}

.btn-cancel:hover {
  background-color: var(--bg-card-border);
}

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

.btn-save:hover {
  background-color: var(--primary-hover);
}

.btn-danger {
  background-color: #FEE2E2;
  color: #991B1B;
}

.btn-danger:hover {
  background-color: #FCA5A5;
}

/* HABITS ANALYTICS TAB DESIGN */
.habits-tracker-dashboard {
  padding: 10px 0;
}

.habit-analytics-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-divider);
}

.habit-analytics-item:last-child {
  border-bottom: none;
}

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

.habit-analytics-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.habit-analytics-streak {
  font-size: 12px;
  font-weight: 700;
  background-color: var(--primary-accent-light);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Last 7 days circles */
.habit-days-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.habit-day-bubble {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bubble-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.bubble-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-card-border);
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bubble-circle.completed {
  background-color: var(--primary-accent);
  border-color: var(--primary-accent);
  color: #FFFFFF;
}

.bubble-circle.completed svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* CALENDAR TAB DESIGN */
.calendar-card {
  padding: 18px;
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-nav h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-nav-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.cal-nav-btn:hover {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
}

.calendar-day-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background-color: var(--bg-app);
}

.calendar-day.empty {
  cursor: default;
  pointer-events: none;
}

.calendar-day.empty:hover {
  background: none;
}

.calendar-day.today {
  border: 1.5px solid var(--text-primary);
}

.calendar-day.selected {
  background-color: var(--primary-accent);
  color: #FFFFFF !important;
}

.calendar-day.selected .day-dot {
  background-color: #FFFFFF;
}

.day-dot {
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--text-secondary);
}

.selected-day-details {
  margin-top: 24px;
}

.day-details-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* FOCUS TIMER (POMODORO) RING INSIDE MODAL */
.focus-timer-ring {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.focus-timer-ring .ring-bg {
  fill: transparent;
  stroke: var(--bg-app);
  stroke-width: 8px;
}

.focus-timer-ring .ring-bar {
  fill: transparent;
  stroke: var(--primary-accent);
  stroke-width: 8px;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

.timer-display-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-time {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.timer-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.timer-controls {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.timer-btn {
  flex: 1;
  padding: 11px 0;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-btn.pri-btn {
  background-color: var(--primary-accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.timer-btn.pri-btn:hover {
  background-color: var(--primary-hover);
}

.timer-btn.sec-btn {
  background-color: var(--bg-app);
  color: var(--text-secondary);
  border: 1.5px solid var(--bg-card-border);
}

.timer-btn.sec-btn:hover {
  background-color: var(--bg-card-border);
  color: var(--text-primary);
}

.timer-modes {
  display: flex;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  border: 1px solid var(--bg-card-border);
}

.timer-mode-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-mode-btn.active {
  background-color: #FFFFFF;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* LOGIN SCREEN & CLOUD SYNC OVERLAY */
.login-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-app);
  z-index: 1500; /* above app dashboard, below splash overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.login-container {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 360px;
  border-radius: 28px;
  border: 1px solid var(--bg-card-border);
  box-shadow: var(--shadow-lg);
  padding: 32px 24px;
  animation: fadeIn 0.4s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-title {
  font-family: var(--font-family);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 0 10px;
}

.setup-info-box {
  background-color: var(--bg-app);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 14px 16px;
}

.login-container textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--bg-card-border);
  background-color: var(--bg-app);
  font-family: monospace;
  font-size: 11px;
  outline: none;
  resize: none;
  line-height: 1.4;
}

.login-container textarea:focus {
  border-color: var(--text-primary);
  background-color: #FFFFFF;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.divider-text {
  text-align: center;
  margin: 20px 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--bg-card-border);
  margin: 0 10px;
}

/* PREMIUM GOOGLE OAUTH BUTTON */
.google-btn {
  width: 100%;
  background-color: #FFFFFF;
  border: 1.5px solid var(--bg-card-border);
  border-radius: 14px;
  padding: 12px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: var(--shadow-sm);
}

.google-btn:hover {
  background-color: var(--bg-app);
}

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

.text-link-btn {
  background: transparent;
  border: none;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
  transition: color 0.2s ease;
}

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

/* AVATAR DROPDOWN MENU */
.avatar-container {
  position: relative;
}

.avatar-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  min-width: 140px;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.dropdown-item {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  text-align: left;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background-color: var(--bg-app);
}

.dropdown-item.danger {
  color: #EF4444;
}

.dropdown-item.danger:hover {
  background-color: #FEF2F2;
}

