:root {
  /* Основные цвета */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  
  /* Акцентные цвета */
  --accent-primary: #06d6a0;
  --accent-secondary: #3b82f6;
  --accent-tertiary: #8b5cf6;
  
  /* Текст */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  /* Статусы */
  --status-new: #3b82f6;
  --status-progress: #f59e0b;
  --status-ready: #10b981;
  --status-done: #6b7280;
  
  /* Приоритеты */
  --priority-high: #ef4444;
  --priority-medium: #f59e0b;
  --priority-low: #10b981;
}

/* Reset and base styles for cross-browser compatibility */
* {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

*:before,
*:after {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container with improved responsive behavior */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header with improved cross-browser support */
.header {
  background-color: var(--bg-secondary);
  padding: 1rem 0;
  -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
     -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
          box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100;
  margin-bottom: 1rem;
}

/* Navigation with improved mobile support */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    color: inherit !important;
    background: none !important;
    box-shadow: none !important;
    position: relative;
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
}

.logo-link::before,
.logo-link::after {
    content: none !important;
    display: none !important;
}

.logo {
    font-size: 2.0rem;
    font-weight: 700;
    color: var(--accent-primary) !important;
    transition: color 0.2s;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    background: none !important;
    box-shadow: none !important;
    display: block;
    user-select: none;
    -webkit-touch-callout: none;
}

.logo:hover {
    color: #05b88a !important;
}

.news-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    transition: color 0.2s;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    background: none !important;
    box-shadow: none !important;
    margin-left: 11px;
    display: inline-block;
    user-select: none;
    -webkit-touch-callout: none;
}

.news-link:hover {
    color: var(--accent-primary) !important;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    padding: 0.5rem 0;
    -webkit-tap-highlight-color: transparent;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 101;
    width: 30px;
    height: 30px;
    justify-content: center;
    align-items: center;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Main content with improved centering */
.main-content-centered {
  padding: 2rem 0;
  margin-top: 2rem;
  min-height: calc(100vh - 160px);
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
     -moz-box-align: start;
      -ms-flex-align: start;
          align-items: flex-start;
}

.main-content-stretched {
  padding: 2rem 0;
  margin-top: 2rem;
  min-height: calc(100vh - 160px);
  width: 100%;
}

.content-spacer {
  height: 2rem;
}

/* Card component with improved styling */
.card {
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  padding: 1.5rem;
  -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
     -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
          box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  -webkit-transition: -webkit-box-shadow 0.2s;
  transition: -webkit-box-shadow 0.2s;
  -o-transition: box-shadow 0.2s;
  -moz-transition: box-shadow 0.2s, -moz-box-shadow 0.2s;
  transition: box-shadow 0.2s;
  transition: box-shadow 0.2s, -webkit-box-shadow 0.2s, -moz-box-shadow 0.2s;
}

.card:hover {
  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
     -moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
          box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-tertiary);
}

/* Button styles with improved cross-browser support */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  -webkit-transition: all 0.2s;
  -o-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
  border: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  -webkit-transition: opacity 0.2s;
  -o-transition: opacity 0.2s;
  -moz-transition: opacity 0.2s;
  transition: opacity 0.2s;
}

.btn:hover:before {
  opacity: 1;
}

.btn:active {
  -webkit-transform: translateY(1px);
      -ms-transform: translateY(1px);
         -o-transform: translateY(1px);
            transform: translateY(1px);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background-color: #05b88a;
}

.btn-secondary {
  background-color: var(--accent-secondary);
  color: white;
}

.btn-secondary:hover {
  background-color: #2563eb;
}

.btn-danger {
  background-color: var(--priority-high);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Status badges with improved styling */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
}

.status-new {
  background-color: var(--status-new);
}

.status-progress {
  background-color: var(--status-progress);
}

.status-ready {
  background-color: var(--status-ready);
}

.status-done {
  background-color: var(--status-done);
}

/* Priority styles */
.priority-high {
  color: var(--priority-high);
}

.priority-medium {
  color: var(--priority-medium);
}

.priority-low {
  color: var(--priority-low);
}

/* Form elements with improved cross-browser support */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-transition: border-color 0.2s;
  -o-transition: border-color 0.2s;
  -moz-transition: border-color 0.2s;
  transition: border-color 0.2s;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  -webkit-box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2);
     -moz-box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2);
          box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2);
}

.form-control::-webkit-input-placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control::-moz-placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control:-ms-input-placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control::-ms-input-placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* Alert styles with improved cross-browser support */
.alert {
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--status-ready);
  color: var(--status-ready);
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--priority-high);
  color: var(--priority-high);
}

/* Kanban board with improved cross-browser support */
.kanban-board {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0 1rem 1rem 1rem;
  -webkit-flex-wrap: nowrap;
  -ms-flex-wrap: nowrap;
  flex-wrap: nowrap;
  -webkit-box-pack: start;
  -webkit-justify-content: flex-start;
  -moz-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  margin-top: 2rem; /* Add spacing from top */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

/* Custom scrollbar for Chrome, Safari and Opera */
.kanban-board::-webkit-scrollbar {
  height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: #05b88a;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.kanban-board::-webkit-scrollbar {
  display: none;
}

.kanban-column {
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  padding: 1rem;
  -webkit-flex: 1 1 0;
      -ms-flex: 1 1 0;
          flex: 1 1 0;
  box-sizing: border-box;
  min-width: 200px;
}

.kanban-column-header {
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-tertiary);
}

.kanban-card {
  background-color: var(--bg-tertiary);
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
  cursor: move;
  -webkit-transition: background-color 0.2s;
  -o-transition: background-color 0.2s;
  -moz-transition: background-color 0.2s;
  transition: background-color 0.2s;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-touch-callout: none;
}

.kanban-card:hover {
  background-color: #475569;
}

/* Teeth chart with improved cross-browser support */
.teeth-chart {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.tooth {
  aspect-ratio: 1;
  background-color: var(--bg-tertiary);
  border-radius: 0.25rem;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
     -moz-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
     -moz-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  cursor: pointer;
  -webkit-transition: all 0.2s;
  -o-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.tooth:hover {
  background-color: var(--accent-secondary);
}

.tooth.selected {
  background-color: var(--accent-primary);
}

/* Table styles with improved cross-browser support */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--bg-tertiary);
}

.table th {
  background-color: var(--bg-tertiary);
  font-weight: 600;
}

.table th:first-child,
.table td:first-child {
  padding-left: 0;
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

/* Utility classes with cross-browser prefixes */
.d-flex {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
}

.justify-content-between {
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
     -moz-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
}

.align-items-center {
  -webkit-box-align: center;
  -webkit-align-items: center;
     -moz-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}

.text-center {
  text-align: center;
}

/* Settings section with improved styling */
.settings-section {
  margin-bottom: 2rem;
}

.settings-section-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-tertiary);
}

.settings-link {
  display: block;
  padding: 0.75rem;
  background-color: var(--bg-tertiary);
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  text-decoration: none;
  -webkit-transition: background-color 0.2s;
  -o-transition: background-color 0.2s;
  -moz-transition: background-color 0.2s;
  transition: background-color 0.2s;
}

.settings-link:hover {
  background-color: #475569;
}

.feedback-form {
  background-color: var(--bg-tertiary);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.feedback-form .form-group {
  margin-bottom: 1.5rem;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header {
        padding: 0.75rem 0;
    }
    
    .navbar {
        flex-wrap: wrap;
        position: relative;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .news-link {
        font-size: 1rem;
        margin-left: 10px;
    }
    
    /* Mobile menu toggle button - mobile only */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Navigation links - mobile only */
    .nav-links {
        display: none !important;
        width: 100%;
        flex-direction: column !important;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--bg-tertiary);
        background-color: var(--bg-secondary);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 100;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        display: flex !important;
    }
    
    .nav-link {
        padding: 0.75rem 0;
        width: 100%;
        text-align: left;
    }
    
    .main-content-centered {
        padding: 1rem 0;
        min-height: calc(100vh - 100px);
    }
    
    .card {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .card-header {
        font-size: 1.125rem;
    }
    
    .kanban-board {
        flex-direction: column;
        overflow-x: hidden;
    }
    
    .kanban-column {
        min-width: 100%;
        margin-bottom: 1rem;
    }
    
    .teeth-chart {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.4rem;
        font-size: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header {
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 1.125rem;
    }
    
    .news-link {
        font-size: 0.9rem;
        margin-left: 8px;
    }
    
    .card {
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .card-header {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .form-control {
        padding: 0.3rem;
        font-size: 0.9rem;
    }
    
    .teeth-chart {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .status-badge {
        padding: 0.125rem 0.25rem;
        font-size: 0.625rem;
    }
    
    .kanban-column {
        width: calc(100% - 1rem);
    }
}

/* Large devices - ensure mobile menu button is hidden on desktop */
@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* Medium devices */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 90%;
  }
  
  .kanban-column {
    min-width: 200px;
    width: calc(50% - 1rem);
  }
}

/* Large devices */
@media (min-width: 1025px) {
  .container {
    max-width: 1200px;
  }
  
  .kanban-board {
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
       -moz-box-pack: start;
        -ms-flex-pack: start;
            justify-content: flex-start;
  }
}

/* Touch device enhancements */
@media (hover: none) and (pointer: coarse) {
  .btn {
    padding: 0.6rem 1.2rem;
  }
  
  .nav-link {
    padding: 0.75rem 0;
  }
  
  .tooth {
    min-height: 40px;
  }
  
  .kanban-card {
    -webkit-transition: none;
    -o-transition: none;
    -moz-transition: none;
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #333333;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
  }
  
  .card {
    border: 1px solid var(--text-secondary);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    -webkit-animation-duration: 0.01ms !important;
            animation-duration: 0.01ms !important;
    -webkit-animation-iteration-count: 1 !important;
            animation-iteration-count: 1 !important;
    -webkit-transition-duration: 0.01ms !important;
         -o-transition-duration: 0.01ms !important;
            transition-duration: 0.01ms !important;
  }
}