/* Mobile styles — max-width: 768px */

.mobile-only {
  display: none;
}

.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .form-label {
      display: none;
  }

  .header-center {
    display: block;
  }

  .header-center .app-logo {
    background: linear-gradient(90deg, #6366f1, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .app-content {
    padding-bottom: 80px;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Header: скрыть кнопку Add transaction */
  .header-left {
    display: none;
  }

  /* Dashboard: одна колонка, скрыть форму */
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }

  .layout-sidebar {
    display: none;
  }

  /* Transactions/Categories: section-nav в колонку */
  .section-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .section-nav .period-selector {
    order: 3;
    justify-content: center;
  }

  .section-nav .period-buttons {
    order: 2;
    justify-self: auto;
  }

  .section-nav .transaction-tabs {
    order: 1;
  }

  /* Tags: заголовок на всю строку по центру, табы по центру + сортировка справа */
  .section-nav--tags {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
      ". title new"
      ". tabs  sort";
    gap: 10px;
  }

  .section-nav--tags .title-lg {
    grid-area: title;
    text-align: center;
  }

  .section-nav--tags .transaction-tabs {
    grid-area: tabs;
  }

  .section-nav--tags .sort-link {
    grid-area: sort;
    align-self: center;
    justify-self: end;
  }

  .new-tag-link {
    display: flex;
    grid-area: new;
    align-self: center;
    justify-self: end;
    color: #44403c;
  }

  /* Summary cards: скрыть Balance */
  .summary-row .summary-card:last-child {
    display: none;
  }

  .summary-row {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .summary-card {
    padding: 8px;
  }

  .form-control,
  .ts-wrapper .ts-control,
  .ts-wrapper .ts-control input,
  .ts-wrapper .item {
    font-size: 16px;
  }

  .amount-field {
    font-size: 28px;
  }

  .nav-bar {
    border: none;
    padding: 0;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .chart-container {
    border: none;
    padding: 0;
  }

  .category-icon {
    width: 56px;
    height: 56px;
  }

  .category-icon svg {
    width: 48px;
    height: 48px;
  }

  .category-card-amount {
    font-size: 14px;
  }

  .dropdown-menu {
    right: auto;
    left: 0;
  }

  .transaction-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }

  .section-label {
    text-transform: none;
  }

  .bottom-nav {
    transition: transform 0.3s ease;
  }

  .bottom-nav.nav-hidden {
    transform: translateY(100%);
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #1c1917;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 10px;
    flex: 1;
  }

  .bottom-nav-item svg {
    width: 22px;
    height: 22px;
  }

  .bottom-nav-item.active {
    color: #fff;
  }

  .bottom-nav-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #6366f1;
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
  }

  .bottom-nav-add svg {
    width: 24px;
    height: 24px;
  }

  .auth-card {
    margin: 20px 16px 0 16px;
    padding: 24px 20px;
  }

  .date-field-wrapper {
    position: relative;
  }

  .date-field-wrapper::after {
    content: "⌄";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-60%);
    color: #9ca3af;
    font-size: 18px;
    pointer-events: none;
  }

  .date-field-wrapper .form-control {
    padding-right: 36px;
  }
}
