/* ─────────────────────────────────────
   DriversSystem — Menu Page (Freedom24 Style)
   ───────────────────────────────────── */

/* ── Page layout ── */
.ds-profile-page {
  background: linear-gradient(160deg, #f5f7fa 0%, #eef1f6 100%);
  min-height: 100vh;
  overflow-y: auto;
}

/* ── Header (plain text, scrolls with content) ── */
.ds-page-header {
  padding: 14px 18px 12px;
  padding-top: max(14px, env(safe-area-inset-top, 14px));
}
.ds-page-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  margin: 0;
}

/* ── Main ── */
.ds-profile-main {
  padding: 20px 16px 100px;
  padding-top: max(20px, env(safe-area-inset-top, 20px));
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* When settings hub is open, shrink bottom padding so it fits on screen */
.ds-profile-main.ds-settings-active {
  padding-bottom: 20px;
}

/* ══════════════════════════════════════
   LOGIN SECTION
   ══════════════════════════════════════ */
.ds-profile-login { text-align: center; padding: 32px 24px; }
.ds-profile-login__icon { font-size: 56px; margin-bottom: 12px; opacity: 0.9; }
.ds-profile-login__title {
  font-size: 22px; font-weight: 700; color: #1a1a2e; margin: 0 0 8px;
}
.ds-profile-login__desc {
  font-size: 14px; color: #6b7280; margin: 0 0 24px; line-height: 1.5;
}
.ds-profile-login__form { display: flex; flex-direction: column; gap: 16px; }
.ds-profile-field { text-align: left; }
.ds-profile-field__label {
  display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px;
}
.ds-profile-phone-input {
  width: 100%; padding: 14px 16px; font-size: 18px; font-weight: 600;
  letter-spacing: 1px; border: 2px solid #e5e7eb; border-radius: 12px;
  background: #fff; color: #1a1a2e; text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box;
}
.ds-profile-phone-input:focus {
  outline: none; border-color: #00c896;
  box-shadow: 0 0 0 4px rgba(0, 200, 150, 0.15);
}
.ds-profile-phone-input::placeholder {
  color: #9ca3af; font-weight: 400; letter-spacing: 0;
}
.ds-profile-login__btn {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, #00c896 0%, #00a87a 100%);
  color: #fff; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s;
}
.ds-profile-login__btn:active { transform: scale(0.97); }
.ds-profile-login__btn:hover { box-shadow: 0 4px 16px rgba(0, 200, 150, 0.35); }
.ds-profile-login__error {
  font-size: 14px; color: #ef4444; padding: 10px;
  background: rgba(239, 68, 68, 0.08); border-radius: 8px; text-align: center;
}

/* ══════════════════════════════════════
   PROFILE HERO (Freedom24 top section)
   ══════════════════════════════════════ */
.ds-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 24px;
  gap: 6px;
}

.ds-profile-hero__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c896 0%, #00a87a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 10px;
  box-shadow: 0 4px 20px rgba(0, 200, 150, 0.3);
}

.ds-profile-hero__name {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0;
  text-align: center;
}

.ds-profile-hero__detail {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  text-align: center;
  line-height: 1.4;
}

/* ══════════════════════════════════════
   MENU LIST (Freedom24-style rows)
   ══════════════════════════════════════ */
.ds-menu-list {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.ds-menu-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  position: relative;
}

.ds-menu-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 62px;
  right: 18px;
  height: 1px;
  background: #f0f0f0;
}

.ds-menu-row:active {
  background: rgba(0, 0, 0, 0.03);
}

/* Icon circle */
.ds-menu-row__icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ds-menu-row__icon-wrap--blue {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}
.ds-menu-row__icon-wrap--green {
  background: rgba(0, 200, 150, 0.12);
  color: #00c896;
}
.ds-menu-row__icon-wrap--orange {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.ds-menu-row__icon-wrap--purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}
.ds-menu-row__icon-wrap--red {
  background: rgba(239, 68, 68, 0.10);
  color: #ef4444;
}
.ds-menu-row__icon-svg {
  width: 22px;
  height: 22px;
}

/* Body */
.ds-menu-row__body {
  flex: 1;
  min-width: 0;
}
.ds-menu-row__title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
}
.ds-menu-row__desc {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

/* Chevron */
.ds-menu-row__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #c5c9d0;
}
.ds-menu-row__chevron svg {
  width: 100%;
  height: 100%;
}

/* ── Logout Button ── */
.ds-menu-logout {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  margin-top: 8px;
  background: #fff;
  border-radius: 16px;
  border: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background 0.15s;
}
.ds-menu-logout:active { background: rgba(239, 68, 68, 0.04); }
.ds-menu-logout__text {
  font-size: 15px;
  font-weight: 600;
  color: #ef4444;
}

/* ── Version Badge ── */
.ds-version-badge {
  text-align: center; padding: 16px 0 8px;
  font-size: 11px; color: #9ca3af; letter-spacing: 0.3px;
}
.ds-version-badge__label { font-weight: 600; }
.ds-version-badge__value { font-weight: 700; color: #7b8794; }
.ds-version-badge__build {
  display: block; margin-top: 2px; font-size: 10px; color: #b0b8c4;
}

/* ══════════════════════════════════════
   SETTINGS — INLINE PANEL (same pattern as review)
   ══════════════════════════════════════ */
.ds-settings-overlay {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
  min-height: calc(100dvh - 140px);
  justify-content: flex-start;
  animation: ds-fade-in 0.2s ease;
}

/* When sub-panels have more content, allow natural flow */
.ds-settings-overlay.ds-settings--subpanel-open {
  justify-content: flex-start;
}

@keyframes ds-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ds-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ds-settings-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 20px;
}

.ds-settings-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.ds-settings-back-btn:active { background: #f3f4f6; }
.ds-settings-back-btn svg {
  width: 18px;
  height: 18px;
  color: #374151;
}

.ds-settings-panel__title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

/* Settings sections */
.ds-settings-section {
  padding: 20px 20px 0;
}

.ds-settings-section__label {
  font-size: 13px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
}

.ds-settings-section__desc {
  font-size: 13px;
  color: #6b7280;
  margin: -6px 0 12px;
  line-height: 1.4;
}

/* Read-only fields */
.ds-settings-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
}

.ds-settings-field__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
.ds-settings-field__icon-svg {
  width: 18px;
  height: 18px;
}

.ds-settings-field__body {
  flex: 1;
  min-width: 0;
}

.ds-settings-field__label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.ds-settings-field__value {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-settings-field__lock {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #d1d5db;
}
.ds-settings-field__lock svg {
  width: 100%;
  height: 100%;
}

.ds-settings-field__hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 10px 0 0;
  font-style: italic;
  line-height: 1.4;
}

/* Editable field (license plate) */
.ds-settings-field__input {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1a2e;
  outline: none;
}
.ds-settings-field__input::placeholder {
  color: #c4c9d2;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ds-settings-field__edit {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #9ca3af;
  transition: color 160ms ease;
}
.ds-settings-field__edit svg {
  width: 100%;
  height: 100%;
}
.ds-settings-field--editable:focus-within .ds-settings-field__edit { color: #059669; }
.ds-settings-field__edit.is-saving { color: #d1d5db; }
.ds-settings-field__edit.is-saved { color: #059669; }
.ds-settings-field__edit.is-error { color: #dc2626; }

/* ── App Checkboxes ── */
.ds-settings-apps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ds-settings-app-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.ds-settings-app-row:active { background: rgba(0, 0, 0, 0.03); }

.ds-settings-app-row__check {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.ds-settings-app-row__check svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.15s;
}

.ds-settings-app-row.active .ds-settings-app-row__check {
  background: #00c896;
  border-color: #00c896;
}
.ds-settings-app-row.active .ds-settings-app-row__check svg {
  opacity: 1;
  color: #fff;
}

.ds-settings-app-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ds-settings-app-row__name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
}

/* ── Default App radio selector ── */
.ds-settings-default {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ds-settings-default-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.4;
  pointer-events: none;
}
.ds-settings-default-row.enabled {
  opacity: 1;
  pointer-events: auto;
}
.ds-settings-default-row:active { background: rgba(0, 0, 0, 0.03); }

.ds-settings-default-row__radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.ds-settings-default-row__radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s;
}

.ds-settings-default-row.selected .ds-settings-default-row__radio {
  border-color: #00c896;
}
.ds-settings-default-row.selected .ds-settings-default-row__radio-dot {
  background: #00c896;
}

.ds-settings-default-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ds-settings-default-row__name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
}

.ds-settings-default-row__lock {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #00c896;
  display: none;
}
.ds-settings-default-row__lock svg {
  width: 100%;
  height: 100%;
}
.ds-settings-default-row.selected .ds-settings-default-row__lock {
  display: block;
}

.ds-settings-none-label {
  font-size: 13px;
  color: #9ca3af;
  padding: 8px 14px;
  font-style: italic;
}

/* ══════════════════════════════════════
   DELETE CONFIRMATION MODAL
   (mirrors entries.css ds-confirm-*)
   ══════════════════════════════════════ */
.ds-confirm-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  padding: 20px;
  animation: ds-overlay-in 0.18s ease;
}
.ds-confirm-overlay[hidden] { display: none !important; }

@keyframes ds-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ds-confirm-pop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

.ds-confirm-dialog {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 340px;
  width: 100%;
  padding: 24px 22px 20px;
  animation: ds-confirm-pop 0.22s ease;
}

.ds-confirm-dialog__icon {
  width: 48px; height: 48px; margin: 0 auto 14px;
  background: rgba(239, 68, 68, 0.1); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #ef4444;
}

.ds-confirm-dialog__title {
  margin: 0 0 6px; font-size: 17px; font-weight: 700;
  color: #1a2232; text-align: center;
}

.ds-confirm-dialog__body {
  margin: 0 0 20px; font-size: 14px; line-height: 1.45;
  color: #64748b; text-align: center;
}

.ds-confirm-dialog__actions { display: flex; gap: 10px; }

.ds-confirm-btn {
  flex: 1; padding: 12px 10px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
}
.ds-confirm-btn:active { transform: scale(0.96); }

.ds-confirm-btn--cancel {
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}
.ds-confirm-btn--cancel:hover { background: #e2e8f0; }

.ds-confirm-btn--danger {
  background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff;
}
.ds-confirm-btn--danger:hover { opacity: 0.9; }

/* ══════════════════════════════════════
   EXPENSE REVIEW PANEL
   ══════════════════════════════════════ */
.ds-review-panel {
  display: flex; flex-direction: column; gap: 12px;
}
.ds-review-header { display: flex; align-items: center; gap: 12px; }
.ds-review-back {
  padding: 8px 14px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; color: #374151; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.ds-review-back:hover { background: #f3f4f6; }
.ds-review-header__title {
  font-size: 18px; font-weight: 700; color: #1a1a2e; margin: 0;
}

/* Category filter tabs */
.ds-review-filters {
  display: flex; gap: 6px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; padding: 2px 0;
}
.ds-review-filter {
  padding: 8px 14px; border-radius: 20px; border: 1px solid #e5e7eb;
  background: #fff; color: #374151; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.2s; flex-shrink: 0;
}
.ds-review-filter.active {
  background: linear-gradient(135deg, #00c896 0%, #00a87a 100%);
  color: #fff; border-color: transparent;
}
.ds-review-filter:active { transform: scale(0.95); }

/* Month navigation */
.ds-review-month-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.ds-review-month-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #e5e7eb;
  background: #fff; color: #374151; font-size: 18px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.ds-review-month-btn:hover { background: #f3f4f6; }
.ds-review-month-label {
  font-size: 15px; font-weight: 700; color: #1a1a2e;
  min-width: 140px; text-align: center;
}

/* Totals */
.ds-review-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ds-review-total-card {
  background: #f9fafb; border-radius: 12px; padding: 14px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.ds-review-total__label {
  font-size: 12px; color: #9ca3af; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ds-review-total__value { font-size: 20px; font-weight: 700; color: #1a1a2e; }

/* Expense list */
.ds-review-list { display: flex; flex-direction: column; gap: 8px; }
.ds-review-empty { text-align: center; padding: 32px 16px; color: #9ca3af; font-size: 14px; }
.ds-review-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: #fff; border-radius: 14px; border: 1px solid #f0f0f0;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.2s;
}
.ds-review-item:active { transform: scale(0.98); }
.ds-review-item:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }
.ds-review-item__cat-icon { display: none; }
.ds-review-item__info { flex: 1; min-width: 0; }
.ds-review-item__name {
  font-size: 14px; font-weight: 600; color: #1a1a2e; display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ds-review-item__meta {
  font-size: 12px; color: #9ca3af; display: block; margin-top: 2px;
}
.ds-review-item__amount {
  font-size: 16px; font-weight: 700; color: #ef4444;
  flex-shrink: 0; white-space: nowrap;
}
.ds-review-item__arrow { color: #d1d5db; font-size: 18px; flex-shrink: 0; }

/* ══════════════════════════════════════
   EDIT EXPENSE MODAL
   ══════════════════════════════════════ */
.ds-edit-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.5); display: flex;
  align-items: flex-end; justify-content: center;
  animation: ds-fade-in 0.2s ease;
}
.ds-edit-dialog {
  width: 100%; max-width: 480px; padding: 24px;
  border-radius: 20px 20px 0 0; animation: ds-slide-up 0.25s ease;
  max-height: 90vh; overflow-y: auto;
  background: #fff;
}
.ds-edit-dialog__title {
  font-size: 18px; font-weight: 700; color: #1a1a2e;
  margin: 0 0 20px; text-align: center;
}
.ds-edit-field { margin-bottom: 14px; }
.ds-edit-field__label {
  display: block; font-size: 13px; font-weight: 600;
  color: #374151; margin-bottom: 6px;
}
.ds-edit-field__input {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 2px solid #e5e7eb; border-radius: 10px;
  background: #f9fafb; color: #1a1a2e;
  transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box;
}
.ds-edit-field__input:focus {
  outline: none; border-color: #00c896;
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}
.ds-edit-field__select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
.ds-edit-actions { display: flex; gap: 10px; margin-top: 20px; }
.ds-edit-btn {
  flex: 1; padding: 12px; font-size: 14px; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.ds-edit-btn:active { transform: scale(0.95); }
.ds-edit-btn--cancel { background: #f3f4f6; color: #6b7280; }
.ds-edit-btn--delete { background: #fef2f2; color: #ef4444; flex: 0.8; }
.ds-edit-btn--delete:hover { background: #fde8e8; }
.ds-edit-btn--save {
  background: linear-gradient(135deg, #00c896 0%, #00a87a 100%); color: #fff;
}
.ds-edit-btn--save:hover { box-shadow: 0 4px 16px rgba(0, 200, 150, 0.35); }

/* ── Auth Guard Overlay ── */
.ds-auth-guard {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(245, 247, 250, 0.97);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.ds-auth-guard__inner { text-align: center; max-width: 360px; }
.ds-auth-guard__icon { font-size: 64px; margin-bottom: 16px; opacity: 0.85; }
.ds-auth-guard__title { font-size: 20px; font-weight: 700; color: #1a1a2e; margin: 0 0 8px; }
.ds-auth-guard__desc { font-size: 14px; color: #6b7280; margin: 0 0 24px; line-height: 1.5; }
.ds-auth-guard__btn {
  display: inline-block; padding: 14px 32px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, #00c896 0%, #00a87a 100%);
  color: #fff; cursor: pointer; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
}
.ds-auth-guard__btn:active { transform: scale(0.97); }
.ds-auth-guard__btn:hover { box-shadow: 0 4px 16px rgba(0, 200, 150, 0.35); }

/* ══════════════════════════════════════
   DARK MODE
   ══════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  /* Auth guard */
  .ds-auth-guard { background: rgba(11, 15, 26, 0.97); }
  .ds-auth-guard__title { color: #f0f4f8; }
  .ds-auth-guard__desc { color: #8896a6; }

  /* Login */
  .ds-profile-login__title { color: #f0f4f8; }
  .ds-profile-login__desc { color: #8896a6; }
  .ds-profile-phone-input {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f0f4f8;
  }
  .ds-profile-phone-input::placeholder { color: rgba(255, 255, 255, 0.4); }
  .ds-profile-phone-input:focus {
    border-color: #00c896;
    box-shadow: 0 0 0 4px rgba(0, 200, 150, 0.2);
  }
  .ds-profile-login__error { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

  /* Profile hero */
  .ds-profile-hero__name { color: #f0f4f8; }
  .ds-profile-hero__detail { color: #8896a6; }

  /* Menu list */
  .ds-menu-list {
    background: linear-gradient(145deg, #132742 0%, #0f1f35 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  .ds-menu-row:not(:last-child)::after { background: rgba(255, 255, 255, 0.08); }
  .ds-menu-row:active { background: rgba(255, 255, 255, 0.05); }
  .ds-menu-row__title { color: #f0f4f8; }
  .ds-menu-row__desc { color: #6b7a8a; }
  .ds-menu-row__chevron { color: #4a5568; }

  .ds-menu-row__icon-wrap--blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
  .ds-menu-row__icon-wrap--green { background: rgba(0, 200, 150, 0.15); color: #34d399; }
  .ds-menu-row__icon-wrap--orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
  .ds-menu-row__icon-wrap--purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
  .ds-menu-row__icon-wrap--red { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

  /* Logout */
  .ds-menu-logout {
    background: linear-gradient(145deg, #132742 0%, #0f1f35 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  .ds-menu-logout:active { background: rgba(239, 68, 68, 0.08); }
  .ds-menu-logout__text { color: #fca5a5; }

  /* Version */
  .ds-version-badge { color: #6b7a8d; }
  .ds-version-badge__value { color: #8896a6; }
  .ds-version-badge__build { color: #4a5568; }

  /* Settings panel (inline, not overlay) */
  .ds-settings-panel__header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }
  .ds-settings-panel__title { color: #f0f4f8; }
  .ds-settings-back-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
  }
  .ds-settings-back-btn svg { color: #d0d8e0; }
  .ds-settings-back-btn:active { background: rgba(255, 255, 255, 0.1); }

  .ds-settings-section__label { color: #6b7a8a; }
  .ds-settings-section__desc { color: #6b7a8a; }

  .ds-settings-field { border-bottom-color: rgba(255, 255, 255, 0.06); }
  .ds-settings-field__icon { color: #6b7a8a; }
  .ds-settings-field__label { color: #6b7a8a; }
  .ds-settings-field__value { color: #f0f4f8; }
  .ds-settings-field__lock { color: #4a5568; }
  .ds-settings-field__hint { color: #6b7a8a; }
  .ds-settings-field__input { color: #f0f4f8; }
  .ds-settings-field__input::placeholder { color: #4a5568; }
  .ds-settings-field__edit { color: #6b7a8a; }
  .ds-settings-field--editable:focus-within .ds-settings-field__edit,
  .ds-settings-field__edit.is-saved { color: #00c896; }

  .ds-settings-app-row:active { background: rgba(255, 255, 255, 0.05); }
  .ds-settings-app-row__check {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
  }
  .ds-settings-app-row.active .ds-settings-app-row__check {
    background: #00c896; border-color: #00c896;
  }
  .ds-settings-app-row__name { color: #f0f4f8; }

  .ds-settings-default-row:active { background: rgba(255, 255, 255, 0.05); }
  .ds-settings-default-row__radio {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
  }
  .ds-settings-default-row.selected .ds-settings-default-row__radio {
    border-color: #00c896;
  }
  .ds-settings-default-row__name { color: #f0f4f8; }
  .ds-settings-default-row__lock { color: #34d399; }

  /* Settings none label */
  .ds-settings-none-label { color: #6b7a8a; }

  /* Profile field label */
  .ds-profile-field__label { color: #8896a6; }

  /* Delete confirm (dark) */
  .ds-confirm-overlay { background: rgba(0, 0, 0, 0.65) !important; }
  .ds-confirm-dialog {
    background: linear-gradient(145deg, #132742 0%, #0f1f35 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5) !important;
  }
  .ds-confirm-dialog__icon { background: rgba(239, 68, 68, 0.15) !important; }
  .ds-confirm-dialog__title { color: #f0f4f8 !important; }
  .ds-confirm-dialog__body { color: #8896a6 !important; }
  .ds-confirm-btn--cancel {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #d0d8e0 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
  }
  .ds-confirm-btn--cancel:hover { background: rgba(255, 255, 255, 0.14) !important; }
  .ds-confirm-btn--danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #fff !important;
  }

  /* Review panel (dark) */
  .ds-review-header__title { color: #f0f4f8; }
  .ds-review-back {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #d0d8e0;
  }
  .ds-review-back:hover { background: rgba(255, 255, 255, 0.1); }
  .ds-review-filter {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #d0d8e0;
  }
  .ds-review-filter.active { border-color: transparent; }
  .ds-review-month-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #d0d8e0;
  }
  .ds-review-month-btn:hover { background: rgba(255, 255, 255, 0.1); }
  .ds-review-month-label { color: #f0f4f8; }
  .ds-review-total-card { background: rgba(255, 255, 255, 0.06); }
  .ds-review-total__label { color: #6b7a8a; }
  .ds-review-total__value { color: #f0f4f8; }
  .ds-review-empty { color: #6b7a8a; }
  .ds-review-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
  }
  .ds-review-item:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
  .ds-review-item__name { color: #f0f4f8; }
  .ds-review-item__meta { color: #6b7a8a; }
  .ds-review-item__amount { color: #fca5a5; }
  .ds-review-item__arrow { color: #4a5568; }

  /* Edit modal (dark) */
  .ds-edit-overlay { background: rgba(0, 0, 0, 0.7); }
  .ds-edit-dialog { background: #1c2438; }
  .ds-edit-dialog__title { color: #f0f4f8; }
  .ds-edit-field__label { color: #d0d8e0; }
  .ds-edit-field__input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f0f4f8;
  }
  .ds-edit-field__input:focus {
    border-color: #00c896;
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.2);
  }
  .ds-edit-btn--cancel { background: rgba(255, 255, 255, 0.06); color: #8896a6; }
  .ds-edit-btn--delete { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

}

/* ══════════════════════════════════════
   SETTINGS — CATEGORY LIST (separated cards)
   ══════════════════════════════════════ */
.ds-settings-catlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.ds-settings-catrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  width: 100%;
  border: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, transform 0.1s;
  position: relative;
}

.ds-settings-catrow:active {
  background: #f9fafb;
  transform: scale(0.98);
}

.ds-settings-catrow__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ds-settings-catrow__icon svg {
  width: 22px;
  height: 22px;
}
.ds-settings-catrow__icon--blue {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}
.ds-settings-catrow__icon--green {
  background: rgba(0, 200, 150, 0.12);
  color: #00c896;
}
.ds-settings-catrow__icon--purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.ds-settings-catrow__body {
  flex: 1;
  min-width: 0;
}

.ds-settings-catrow__title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
}

.ds-settings-catrow__desc {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-settings-catrow__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #c5c9d0;
}
.ds-settings-catrow__chevron svg {
  width: 100%;
  height: 100%;
}

/* Sub-panel */
.ds-settings-subpanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: ds-fade-in 0.2s ease;
}

/* ── Settings sub-panel sections: inherit card styles ── */
.ds-settings-subpanel .ds-settings-section {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
}

/* ══════════════════════════════════════
   SAVINGS — MULTI-GOAL CARDS
   ══════════════════════════════════════ */
.ds-savings-goals {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.ds-savings-goal-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.ds-savings-goal-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 200, 150, 0.12);
  color: #00c896;
}
.ds-savings-goal-card__icon svg {
  width: 22px;
  height: 22px;
}

.ds-savings-goal-card__body {
  flex: 1;
  min-width: 0;
}

.ds-savings-goal-card__title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-savings-goal-card__amount {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #00c896;
  margin-top: 2px;
}

.ds-savings-goal-card__deadline {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.ds-savings-goal-card__permonth {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3b82f6;
  margin-top: 1px;
}

.ds-savings-goal-card__delete {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ds-savings-goal-card__delete:active { background: rgba(239, 68, 68, 0.18); }
.ds-savings-goal-card__delete svg {
  width: 16px;
  height: 16px;
}

/* Total row */
.ds-savings-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f9fafb;
  border-radius: 12px;
  margin-top: 4px;
  margin-bottom: 16px;
}

.ds-savings-total__label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.ds-savings-total__value {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a2e;
}

/* Add button */
.ds-savings-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 2px dashed #d1d5db;
  border-radius: 14px;
  background: transparent;
  color: #6b7280;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.15s;
}
.ds-savings-add-btn svg {
  width: 20px;
  height: 20px;
}
.ds-savings-add-btn:active {
  background: rgba(0, 200, 150, 0.04);
  border-color: #00c896;
  color: #00c896;
}

/* Empty state */
.ds-savings-empty {
  text-align: center;
  padding: 32px 16px;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.5;
}

/* ══════════════════════════════════════
   SAVINGS — ADD/EDIT MODAL (bottom sheet)
   ══════════════════════════════════════ */
.ds-savings-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: ds-fade-in 0.2s ease;
}

.ds-savings-modal__dialog {
  width: 100%;
  max-width: 480px;
  padding: 28px 24px 32px;
  border-radius: 20px 20px 0 0;
  background: #fff;
  animation: ds-slide-up 0.25s ease;
  overflow: hidden;
  box-sizing: border-box;
}

@keyframes ds-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ds-savings-modal__title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 24px;
  text-align: center;
}

.ds-savings-modal__field {
  margin-bottom: 16px;
  overflow: hidden;
}

.ds-savings-modal__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.ds-savings-modal__input {
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Month input — prevent iOS overflow */
.ds-savings-modal__input[type="month"] {
  min-width: 0;
  -webkit-min-logical-width: 0;
}
.ds-savings-modal__input:focus {
  border-color: #00c896;
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.12);
}
.ds-savings-modal__input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.ds-savings-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.ds-savings-modal__btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
}
.ds-savings-modal__btn:active { transform: scale(0.96); }

.ds-savings-modal__btn--cancel {
  background: #f1f5f9;
  color: #475569;
}

.ds-savings-modal__btn--save {
  background: linear-gradient(135deg, #00c896 0%, #00a87a 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 200, 150, 0.25);
}

/* ══════════════════════════════════════════════════
   DARK MODE — Settings, Savings, Sub-panels
   (Must appear AFTER light-mode rules to override)
   ══════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {

  /* ── Settings category cards ── */
  .ds-settings-catrow {
    background: linear-gradient(145deg, #132742 0%, #0f1f35 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  .ds-settings-catrow:active {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(0.98);
  }
  .ds-settings-catrow__icon--blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
  .ds-settings-catrow__icon--green { background: rgba(0, 200, 150, 0.15); color: #34d399; }
  .ds-settings-catrow__icon--purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
  .ds-settings-catrow__title { color: #f0f4f8; }
  .ds-settings-catrow__desc { color: #6b7a8a; }
  .ds-settings-catrow__chevron { color: #4a5568; }

  /* ── Settings sub-panel sections ── */
  .ds-settings-subpanel .ds-settings-section {
    background: linear-gradient(145deg, #132742 0%, #0f1f35 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  /* ── Savings goal cards ── */
  .ds-savings-goal-card {
    background: linear-gradient(145deg, #132742 0%, #0f1f35 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  .ds-savings-goal-card__title { color: #f0f4f8; }
  .ds-savings-goal-card__amount { color: #34d399; }
  .ds-savings-goal-card__deadline { color: #6b7a8a; }
  .ds-savings-goal-card__permonth { color: #6ea8fe; }
  .ds-savings-goal-card__delete {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
  }

  /* ── Savings total row ── */
  .ds-savings-total {
    background: rgba(255, 255, 255, 0.06);
  }
  .ds-savings-total__label { color: #6b7a8a; }
  .ds-savings-total__value { color: #f0f4f8; }

  /* ── Savings add button ── */
  .ds-savings-add-btn {
    border-color: rgba(255, 255, 255, 0.12);
    color: #6b7a8a;
  }
  .ds-savings-add-btn:active {
    border-color: #00c896;
    color: #34d399;
    background: rgba(0, 200, 150, 0.05);
  }

  /* ── Savings empty state ── */
  .ds-savings-empty { color: #6b7a8a; }

  /* ── Savings modal (bottom sheet) ── */
  .ds-savings-modal { background: rgba(0, 0, 0, 0.7); }
  .ds-savings-modal__dialog {
    background: linear-gradient(145deg, #132742 0%, #0f1f35 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }
  .ds-savings-modal__title { color: #f0f4f8; }
  .ds-savings-modal__label { color: #d0d8e0; }
  .ds-savings-modal__input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f0f4f8;
  }
  .ds-savings-modal__input::placeholder { color: rgba(255, 255, 255, 0.35); }
  .ds-savings-modal__input:focus {
    border-color: #00c896;
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.2);
  }
  .ds-savings-modal__btn--cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #d0d8e0;
    border: 1px solid rgba(255, 255, 255, 0.12);
  }
  .ds-savings-modal__btn--save {
    background: linear-gradient(135deg, #00c896 0%, #00a87a 100%);
    color: #fff;
  }
  .ds-savings-modal__preview {
    color: #34d399 !important;
  }
}