:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --hint-color: #666666;
  --secondary-bg: #f5f5f5;
  --button-color: #3390ec;
  --button-text: #ffffff;
  --link-color: #3390ec;
  --border-color: #dddddd;
}

[data-theme="dark"] {
  --bg-color: #1c1c1e;
  --text-color: #ffffff;
  --hint-color: #8e8e93;
  --secondary-bg: #2c2c2e;
  --button-color: #0a84ff;
  --button-text: #ffffff;
  --link-color: #0a84ff;
  --border-color: #3a3a3c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure emoji rendering across all elements */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 60px;
}

.theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--secondary-bg);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background-color 0.3s;
}

.theme-toggle:hover {
  opacity: 0.8;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--hint-color);
  border-top-color: var(--button-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
  text-align: center;
  padding: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-color);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--secondary-bg);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
  cursor: pointer;
}

.menu-item:active {
  opacity: 0.7;
}

.menu-item-icon {
  font-size: 24px;
  margin-right: 12px;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'EmojiOne Color', 'Android Emoji', sans-serif;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  display: inline-block;
  unicode-bidi: embed;
  direction: ltr;
}

.menu-item-text {
  font-size: 16px;
  font-weight: 500;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:active {
  opacity: 0.8;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--button-color);
  color: var(--button-text);
}

.btn-secondary {
  background: var(--secondary-bg);
  color: var(--text-color);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--hint-color);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-color);
  color: var(--text-color);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--button-color);
}

.form-input.error {
  border-color: #ff3b30;
}

.form-error {
  font-size: 12px;
  color: #ff3b30;
  margin-top: 4px;
}

.card {
  background: var(--secondary-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-text {
  font-size: 14px;
  color: var(--hint-color);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
}

.status-new {
  background: #34c759;
  color: white;
}

.status-in_progress {
  background: #ff9500;
  color: white;
}

.status-closed {
  background: #8e8e93;
  color: white;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 16px;
  color: var(--link-color);
  font-size: 16px;
  background: none;
  border: none;
  cursor: pointer;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--secondary-bg);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.checkbox-item.selected {
  background: var(--button-color);
  color: var(--button-text);
}

.checkbox-item input {
  margin-right: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 20px;
  background: var(--secondary-bg);
  color: var(--text-color);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.tab.active {
  background: var(--button-color);
  color: var(--button-text);
}

.submenu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.submenu-item {
  display: block;
  padding: 14px 16px;
  background: var(--secondary-bg);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  font-size: 15px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

.history-item {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.history-item:last-child {
  border-bottom: none;
}

.history-from {
  font-weight: 600;
  font-size: 14px;
}

.history-time {
  font-size: 12px;
  color: var(--hint-color);
}

.history-text {
  margin-top: 4px;
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--hint-color);
}

.data-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.data-row:last-child {
  border-bottom: none;
}

.data-label {
  color: var(--hint-color);
  font-size: 14px;
}

.data-value {
  font-weight: 500;
  font-size: 14px;
  text-align: right;
  max-width: 60%;
}

.confirmation-step {
  margin-bottom: 16px;
}

.confirm-item {
  margin-bottom: 12px;
}

.view-mode {
  background: var(--secondary-bg);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.view-mode:hover {
  opacity: 0.8;
}

.confirm-label {
  font-size: 12px;
  color: var(--hint-color);
  margin-bottom: 4px;
}

.confirm-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 500;
}

.edit-icon {
  font-size: 14px;
  opacity: 0.6;
}

.edit-mode {
  background: var(--secondary-bg);
  border-radius: 10px;
  padding: 14px 16px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--hint-color);
  font-size: 14px;
}

.step-dots {
  display: flex;
  gap: 6px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  transition: background-color 0.3s;
}

.step-dot.active {
  background: var(--button-color);
}

.step-dot.completed {
  background: #34c759;
}

.registration-form {
  margin-top: 8px;
}

.btn-container {
  margin-top: 24px;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-row .btn {
  flex: 1;
}

.hidden {
  display: none !important;
}
