/**
 * LogiFlow Mobile - Common Styles
 * Общие стили для всех страниц mobile-front
 */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent auto-zoom on iOS Safari when focusing input fields */
/* iOS Safari zooms the page when input font-size is less than 16px */
input,
textarea,
select {
  font-size: 16px;
}

/* CSS Variables - Theme */
:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: rgba(124, 58, 237, 0.1);
  --background: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --error: #ef4444;
  --success: #22c55e;
}

/* Base */
html {
  /* Prevent overscroll/bounce effect on iOS */
  overscroll-behavior: none;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: scroll;
  /* Prevent overscroll/bounce effect */
  overscroll-behavior-x: none;
  /* Enable smooth scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  /* Allow vertical scrolling, prevent horizontal */
  touch-action: pan-y;
}

/* Override #root styles from index.css for mobile pages */
#root {
  height: auto !important;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible !important;
}

/* Mobile Page Wrapper - контейнер для свайп-анимации всей страницы */
.mobile-page-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--background);
  /* Для корректной работы sticky внутри - НЕ используем transform в базовом состоянии */
  overflow: visible;
  /* Анимация перехода между страницами */
  opacity: 1;
  /* transform убран - он ломает position: sticky для header */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Анимация входа страницы справа (навигация вперёд) */
.mobile-page-wrapper.slide-in-start {
  opacity: 0;
  transform: translateX(100%);
}

/* Анимация выхода страницы вправо */
.mobile-page-wrapper.slide-out {
  opacity: 0;
  transform: translateX(100%);
}

/* Анимация входа страницы слева (навигация назад) */
.mobile-page-wrapper.slide-in-from-left {
  opacity: 0;
  transform: translateX(-30%);
}

/* Header - fixed position for proper behavior with transform animations */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 60px;
}

.back-btn {
  box-sizing: border-box;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
  /* Только горизонтальный отрицательный margin */
  margin: 0;
  margin-left: -8px;
}

.back-btn:active {
  background: var(--background);
}

.back-btn svg {
  width: 24px;
  height: 24px;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
}

/* Content */
.content {
  padding: 16px 16px 24px;
  /* Allow vertical scrolling on touch devices */
  touch-action: pan-y;
}

/* Content without side padding (for full-width lists) */
.content.no-padding {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  margin: 0;
}

/* Loading state */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Page transition overlay */
.page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-transition-overlay.active {
  opacity: 1;
  visibility: visible;
}

.page-transition-overlay .spinner {
  width: 32px;
  height: 32px;
}

/* Page content animation */
.page-content {
  opacity: 1;
  transform: translateX(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
  /* Ensure content can scroll */
  min-height: calc(100vh - 60px);
  min-height: calc(100dvh - 60px);
  /* Offset for fixed header */
  padding-top: 60px;
}

.page-content.slide-in-start {
  opacity: 0;
  transform: translateX(100%);
}

.page-content.slide-out {
  opacity: 0;
  transform: translateX(100%);
}

.page-content.slide-in-from-left {
  opacity: 0;
  transform: translateX(-30%);
}

/* Swipe back indicator */
.swipe-indicator {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  opacity: 0;
  z-index: 31;
  border-radius: 0 4px 4px 0;
  transition: opacity 0.2s, width 0.2s;
  pointer-events: none;
}

.swipe-indicator.active {
  opacity: 0.6;
  width: 6px;
}

/* Placeholder section for pages under development */
.placeholder-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.5;
}

.placeholder-icon.error {
  color: var(--error);
}

.placeholder-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.placeholder-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.placeholder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 14px;
  background: var(--primary-light);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
}

.placeholder-badge svg {
  width: 14px;
  height: 14px;
}

/* Card styles */
.card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}

.card-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.card-content {
  padding: 16px;
}

/* Info text block */
.info-text {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: 10px;
  margin-top: 16px;
}

.info-text svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.info-text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Button styles */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

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

.btn-primary:active {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:active {
  background: var(--background);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
}

.btn-danger:active {
  background: rgba(239, 68, 68, 0.1);
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* List styles */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

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

.list-item:active {
  background: var(--background);
}

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-item-icon svg {
  width: 20px;
  height: 20px;
}

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

.list-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.list-item-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.list-item-arrow {
  color: var(--text-muted);
}

.list-item-arrow svg {
  width: 18px;
  height: 18px;
}

/* ==================== */
/* Dashboard Page Styles */
/* ==================== */

/* Dashboard Header (different from inner page header) */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
}

.menu-btn:active {
  background: var(--background);
}

.menu-btn svg {
  width: 24px;
  height: 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.header-logo span {
  font-size: 17px;
  font-weight: 600;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

/* Dashboard header uses justify-content: space-between */
.header.dashboard-header {
  justify-content: space-between;
}

/* ==================== */
/* Sidebar Styles */
/* ==================== */

:root {
  --sidebar-width: 280px;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100%;
  background: var(--card);
  z-index: 21;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar.active {
  transform: translateX(0);
}

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
}

.close-btn:active {
  background: var(--background);
}

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

/* User info in sidebar */
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
  display: none;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:active {
  transform: scale(0.98);
}

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

.nav-item:not(.active):hover {
  background: var(--background);
}

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

.nav-item.active svg {
  color: var(--primary);
}

.nav-item-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.nav-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.logout-btn-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--error);
  background: transparent;
  border: 1px solid var(--error);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn-sidebar:active {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(0.98);
}

.logout-btn-sidebar svg {
  width: 18px;
  height: 18px;
}

.sidebar-version {
  text-align: center;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== */
/* Welcome Card */
/* ==================== */

.welcome-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 16px;
  padding: 20px;
  color: white;
  margin-bottom: 16px;
}

.welcome-title {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.welcome-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.company-badge svg {
  width: 16px;
  height: 16px;
}

/* ==================== */
/* Quick Actions */
/* ==================== */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.quick-action {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.quick-action:active {
  transform: scale(0.97);
  background: var(--background);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-icon svg {
  width: 22px;
  height: 22px;
}

.quick-action-icon.shipments {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.quick-action-icon.requests {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.quick-action-icon.finances {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.quick-action-icon.settings {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.quick-action-label {
  font-size: 13px;
  font-weight: 500;
}

/* ==================== */
/* Coming Soon Section */
/* ==================== */

.coming-soon {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
}

.coming-soon-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  color: var(--border);
}

.coming-soon h3 {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 6px;
}

.coming-soon p {
  font-size: 13px;
}

/* ==================== */
/* Settings Page Styles */
/* ==================== */

.settings-section {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}

.settings-section-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.settings-section-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-section-content {
  padding: 16px;
}

/* Кликабельная секция */
.settings-section-clickable {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.settings-section-clickable:active {
  background-color: var(--primary-light);
}

.settings-section-clickable .settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==================== */
/* Shipment Details Page Styles */
/* ==================== */

/* Hero card - main shipment info */
.shipment-hero-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 16px;
  padding: 20px;
  color: white;
  margin-bottom: 16px;
}

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

.shipment-hero-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shipment-hero-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.shipment-hero-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.shipment-hero-status.status-final {
  background: rgba(34, 197, 94, 0.3);
}

.shipment-hero-status.status-default {
  background: rgba(59, 130, 246, 0.3);
}

.shipment-hero-number {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.shipment-hero-type {
  font-size: 14px;
  opacity: 0.85;
}

/* Section icons in titles */
.section-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  flex-shrink: 0;
  color: var(--primary);
}

/* Settings section title with icons support */
.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

/* Detail rows */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 14px;
  color: var(--text-muted);
}

.detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.detail-value-highlight {
  color: var(--primary);
  font-weight: 600;
  font-size: 16px;
}

/* Bill status styles */
.bill-status-none {
  color: var(--text-muted);
}

.bill-status-unpaid {
  color: #3b82f6;
  font-weight: 600;
}

.bill-status-paid {
  color: #22c55e;
  font-weight: 600;
}

/* Debt positive - red color for positive debt amount */
.debt-positive {
  color: #ef4444 !important;
  font-weight: 600;
}

/* Cargo grid for weight/volume */
.cargo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cargo-item {
  background: var(--background);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.cargo-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cargo-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.cargo-unit {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Comment block */
.comment-block {
  padding-top: 12px;
}

.comment-block .comment-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-comment {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
  background: var(--background);
  padding: 12px;
  border-radius: 10px;
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  background: var(--background);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.theme-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-toggle-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* Color presets */
.color-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.color-preset {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--background);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.color-preset:active {
  transform: scale(0.98);
}

.color-preset.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.color-preset-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-preset-circle svg {
  width: 18px;
  height: 18px;
}

.color-preset-info {
  flex: 1;
  min-width: 0;
}

.color-preset-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.color-preset-hex {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.color-preset-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
}

.color-preset.active .color-preset-check {
  display: flex;
}

.color-preset-check svg {
  width: 12px;
  height: 12px;
}

/* ==================== */
/* Shipments Page Styles */
/* ==================== */

/* Shipment card header */
.shipment-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Shipment card left side */
.shipment-card-info {
  flex: 1;
  min-width: 0;
}

/* Shipment number */
.shipment-number {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shipment type */
.shipment-type {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Shipment dates row */
.shipment-dates {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.shipment-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.shipment-date .date-label {
  color: var(--text-muted);
  opacity: 0.7;
}

/* Shipment card right side */
.shipment-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Shipment status badge */
.shipment-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.shipment-status.delivered,
.shipment-status.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.shipment-status.in_transit,
.shipment-status.processing {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.shipment-status.cancelled,
.shipment-status.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.shipment-status.new,
.shipment-status.created {
  background: var(--border);
  color: var(--text);
}

/* Status - final (green) */
.shipment-status.status-final {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

/* Status - default (blue) */
.shipment-status.status-default {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

/* Chevron icon */
.chevron-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

/* List container */
.shipments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Cards inside shipments list - no border-radius, no margin */
.shipments-list .card {
  border-radius: 0;
  margin-bottom: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

/* Loading skeleton */
.skeleton {
  background: var(--border);
  border-radius: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-title {
  height: 20px;
  width: 120px;
  margin-bottom: 12px;
}

.skeleton-subtitle {
  height: 16px;
  width: 80px;
}

/* Loading more indicator */
.loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 8px;
}

.loading-more .spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* End of list */
.list-end {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ==================== */
/* Filter Modal Styles  */
/* ==================== */

/* Filter button in header */
.filter-btn {
  box-sizing: border-box;
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  /* Только горизонтальный отрицательный margin */
  margin: 0;
  margin-right: -8px;
}

.filter-btn:active {
  background: var(--background);
}

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

.filter-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Filter Modal (Bottom Sheet) */
.filter-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.filter-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 41;
  display: flex;
  flex-direction: column;
}

.filter-modal-overlay.active .filter-modal {
  transform: translateY(0);
}

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

.filter-modal-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  /* Увеличенная зона касания через padding и псевдоэлемент */
  cursor: grab;
}

/* Большая зона касания для удобного свайпа */
.filter-modal-handle::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -40px;
  right: -40px;
  bottom: -20px;
  /* Итого: ширина 120px, высота 44px */
  /* DEBUG: временно видимая зона
  background: rgba(255, 0, 0, 0.2);
  border: 1px dashed red;
  */
}

.filter-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.filter-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
}

.filter-modal-close svg {
  width: 18px;
  height: 18px;
}

.filter-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  padding-top: 24px;
  -webkit-overflow-scrolling: touch;
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* Collapsible section header */
.filter-section-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.filter-section-header:active {
  background: var(--border);
}

.filter-section-header .filter-section-title {
  margin-bottom: 0;
  flex: 1;
  text-align: left;
}

.filter-section-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.filter-section-content {
  margin-top: 12px;
}

/* Multi-Select Dropdown */
.filter-select-wrapper {
  position: relative;
}

.filter-select-button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s;
}

.filter-select-button.open {
  border-color: var(--primary);
}

.filter-select-button.has-value {
  border-color: var(--primary);
}

.filter-select-text {
  flex: 1;
  text-align: left;
  font-size: 14px;
  color: var(--text);
}

.filter-select-button:not(.has-value) .filter-select-text {
  color: var(--text-muted);
}

.filter-select-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.filter-select-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.filter-select-dropdown {
  /* position: fixed задаётся inline */
  background: var(--card);
  border: 1px solid var(--primary);
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.filter-select-options {
  padding: 4px 0;
}

.filter-select-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.filter-select-option:active {
  background: var(--background);
}

.filter-select-option.selected {
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.1);
}

.filter-select-option-text {
  flex: 1;
  text-align: left;
  font-size: 14px;
  color: var(--text);
}

.filter-select-option.selected .filter-select-option-text {
  color: var(--primary);
  font-weight: 500;
}

.filter-check-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.filter-select-loading,
.filter-select-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.filter-date-row {
  display: flex;
  gap: 12px;
}

.filter-date-field {
  flex: 1;
}

.filter-date-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.filter-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  color: var(--text);
  font-size: 16px; /* Минимум 16px для предотвращения auto-zoom на iOS Safari */
  -webkit-appearance: none;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

/* Date input specific styles */
.filter-input[type="date"] {
  min-height: 44px;
}

.filter-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: var(--calendar-icon-filter, none);
  cursor: pointer;
}

.filter-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.filter-checkbox-item:active {
  background: var(--border);
}

.filter-checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.filter-checkbox-label {
  font-size: 14px;
  color: var(--text);
  flex: 1;
}

.filter-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-modal-footer .btn {
  flex: 1;
}

/* Loading skeleton for filter options */
.filter-skeleton {
  height: 48px;
  background: var(--background);
  border-radius: 12px;
  animation: pulse 1.5s infinite;
}

.filter-skeleton + .filter-skeleton {
  margin-top: 8px;
}

/* Empty state for filters */
.filter-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ==================== */
/* Requests Page Styles */
/* ==================== */

/* Request card header */
.request-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Request card left side */
.request-card-info {
  flex: 1;
  min-width: 0;
}

/* Request number */
.request-number {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Request header row: number + client */
.request-header-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
}

.request-client-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Request description */
.request-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Request shipment row: number left, status right */
.request-shipment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Request card right side */
.request-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Request status badge */
.request-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--border);
  color: var(--text-muted);
}

/* Request status - final (green) */
.request-status.status-final {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

/* Request status - default (blue) */
.request-status.status-default {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

/* Shipment status badge in request card */
.shipment-status-badge {
  display: inline;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: var(--border);
  color: var(--text-muted);
}

/* Shipment status badge - final (green) */
.shipment-status-badge.status-final {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

/* Shipment status badge - default (blue) */
.shipment-status-badge.status-default {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

/* Requests list container */
.requests-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Cards inside requests list - no border-radius, no margin */
.requests-list .card {
  border-radius: 0;
  margin-bottom: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

/* ==================== */
/* Request Details Page Styles */
/* ==================== */

/* Hero card - main request info */
.request-hero-card {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 16px;
  padding: 20px;
  color: white;
  margin-bottom: 16px;
}

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

.request-hero-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.request-hero-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.request-hero-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.request-hero-status.status-final {
  background: rgba(34, 197, 94, 0.4);
}

.request-hero-status.status-default {
  background: rgba(59, 130, 246, 0.4);
}

.request-hero-number {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.request-hero-client {
  font-size: 14px;
  opacity: 0.85;
}

/* ==================== */
/* Offline Indicator    */
/* ==================== */

.offline-indicator {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.offline-indicator.offline {
  background: #ef4444;
  color: white;
}

.offline-indicator.online {
  background: #22c55e;
  color: white;
  animation: slideUpFade 3s ease forwards;
}

.offline-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@keyframes slideUpFade {
  0%, 80% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* ==================== */
/* Files Section Styles */
/* ==================== */

.files-section {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}

.files-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.files-section-header svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.files-count {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Folder styles */
.folder-item {
  border-bottom: 1px solid var(--border);
}

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

.folder-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.folder-header:active {
  background: var(--background);
}

.folder-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.folder-icon svg {
  width: 18px;
  height: 18px;
}

.folder-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.folder-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.folder-chevron.expanded {
  transform: rotate(90deg);
}

.folder-files {
  background: var(--background);
  padding: 8px 0;
}

/* File item styles */
.file-list {
  padding: 0;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 1px solid var(--border);
}

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

.file-item:active {
  background: var(--background);
}

.folder-files .file-item {
  padding: 10px 16px 10px 24px;
  border-bottom: none;
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.file-icon.pdf {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.file-icon.doc {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.file-icon.xls {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.file-icon.img {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.file-icon.default {
  background: var(--background);
  color: var(--text-muted);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-date {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-download-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.file-item.downloading .file-download-icon {
  animation: spin 1s linear infinite;
}

/* Files loading state */
.files-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.files-loading .spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

/* ==================== */
/* Places Section Styles */
/* ==================== */

.places-section {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}

.places-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.places-section-header svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.places-count {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Places summary */
.places-summary {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

.places-summary .summary-item {
  flex: 1;
  text-align: center;
}

.places-summary .summary-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.places-summary .summary-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Place item */
.place-item {
  border-bottom: 1px solid var(--border);
}

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

.place-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.place-header:active {
  background: var(--background);
}

.place-badge {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.place-info {
  flex: 1;
  min-width: 0;
}

.place-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-dimensions {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.place-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.place-chevron.expanded {
  transform: rotate(90deg);
}

/* Place details */
.place-details {
  background: var(--background);
  padding: 12px 16px;
}

.place-params {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.place-params .param-row {
  flex: 1;
}

.place-params .param-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.place-params .param-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Place photos */
.place-photos {
  margin-top: 8px;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: var(--background);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb.primary {
  border: 2px solid var(--primary);
}

.photo-thumb .primary-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* Photo Gallery Overlay */
.photo-gallery-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.photo-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-gallery img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.gallery-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 16px) + 16px);
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav.prev {
  left: 16px;
}

.gallery-nav.next {
  right: 16px;
}

.gallery-indicator {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 16px) + 60px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.gallery-description {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 16px) + 16px);
  left: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
}

.gallery-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 80vh;
}

.gallery-loading .spinner {
  width: 40px;
  height: 40px;
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: white;
}

/* Loading states */
.places-loading,
.photos-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.places-loading .spinner,
.photos-loading .spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.photo-thumb-loading {
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-thumb-loading .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

/* Empty state */
.no-photos {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 8px;
}

/* ==================== */
/* Finances Page Styles */
/* ==================== */

/* Finances list container */
.finances-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Cards inside finances list - no border-radius, no margin */
.finances-list .card {
  border-radius: 0;
  margin-bottom: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

/* Finance card header: number, date, status icons */
.finance-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.finance-card-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.finance-number {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
}

.finance-date {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Status icons container */
.finance-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Status icon base */
.finance-status-icon {
  width: 18px;
  height: 18px;
  color: #9ca3af;
  transition: color 0.2s;
}

.finance-status-icon.active {
  color: #22c55e;
}

/* Type row: operation type + document type */
.finance-type-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 4px;
}

.finance-operation {
  color: var(--text-muted);
}

.finance-operation.in {
  color: #22c55e;
}

.finance-operation.out {
  color: #ef4444;
}

.finance-type-separator {
  color: var(--border);
}

.finance-document-type {
  color: var(--text-muted);
}

/* Counterparty row */
.finance-counterparty {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bottom row: account and amount */
.finance-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.finance-account {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.finance-amount {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =====================
   Finance Details Page
   ===================== */

/* Finance Hero Statuses */
.finance-hero-statuses {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-detail-status-icon {
  width: 20px;
  height: 20px;
  opacity: 0.4;
}

.finance-detail-status-icon.active {
  opacity: 1;
}

/* Finance Hero Type */
.finance-hero-type {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 14px;
  opacity: 0.9;
}

.finance-hero-type .finance-operation {
  font-weight: 500;
}

.finance-hero-type .finance-operation.in {
  color: #22c55e;
}

.finance-hero-type .finance-operation.out {
  color: #ef4444;
}

/* Status indicators */
.status-paid {
  color: #22c55e;
  font-weight: 500;
}

.status-unpaid {
  color: var(--text-muted);
}

/* Clickable rows */
.detail-row.clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.detail-row.clickable:hover {
  background-color: var(--primary-light);
}

.detail-row.clickable:active {
  background-color: rgba(124, 58, 237, 0.15);
}

/* Link value with chevron */
.link-value {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
}

.link-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Related documents section */
.related-docs-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 8px;
}

.related-docs-label:first-child {
  margin-top: 0;
}

/* Service items */
.service-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.service-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.service-item-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.service-item-amount {
  font-weight: 500;
  color: var(--text);
}
