/* ===== CSS Variables ===== */
:root {
  /* Dracula-inspired color scheme */
  --bg-primary: #1a1b26;
  --bg-secondary: #24283b;
  --bg-tertiary: #2f3549;
  --bg-card: #1f2335;
  --bg-hover: #3b4261;
  
  --text-primary: #c0caf5;
  --text-secondary: #a9b1d6;
  --text-muted: #565f89;
  --text-bright: #ffffff;
  
  --accent-primary: #7aa2f7;
  --accent-secondary: #bb9af7;
  --accent-success: #9ece6a;
  --accent-warning: #e0af68;
  --accent-danger: #f7768e;
  --accent-info: #7dcfff;
  
  --border-color: #3b4261;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --transition: all 0.2s ease;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-bright);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-secondary);
}

/* ===== Layout ===== */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}

.nav-menu {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--bg-hover);
  color: var(--text-bright);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(122, 162, 247, 0.2), rgba(187, 154, 247, 0.1));
  border-left: 3px solid var(--accent-primary);
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

/* ===== Header ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(122, 162, 247, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-success {
  background: var(--accent-success);
  color: var(--bg-primary);
}

.btn-danger {
  background: var(--accent-danger);
  color: var(--bg-primary);
}

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

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea,
.form-control,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.2);
}

.form-input::placeholder,
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Для disabled/readonly полей */
.form-control:disabled,
.form-control[readonly],
input:disabled,
input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-secondary);
}

/* Стили для маленького текста под полями */
.form-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* ===== Table ===== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

tr:hover {
  background: var(--bg-hover);
}

tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.pagination-buttons {
  display: flex;
  gap: 0.5rem;
}

.page-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-bright);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.8) translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
  opacity: 0;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid var(--border-color);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin: 0;
}

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

.modal-close:hover {
  color: var(--accent-danger);
  background: rgba(247, 118, 142, 0.1);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  max-height: calc(90vh - 180px);
  overflow-y: auto;
}

/* Кастомный скроллбар для модального окна */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.5rem 2rem;
  border-top: 2px solid var(--border-color);
  background: var(--bg-secondary);
}

/* ===== Progress Bar ===== */
.progress-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.progress-bar-wrapper {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.progress-percentage {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

/* ===== Status Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background: rgba(224, 175, 104, 0.2);
  color: var(--accent-warning);
}

.badge-processing {
  background: rgba(125, 207, 255, 0.2);
  color: var(--accent-info);
}

.badge-completed {
  background: rgba(158, 206, 106, 0.2);
  color: var(--accent-success);
}

.badge-failed {
  background: rgba(247, 118, 142, 0.2);
  color: var(--accent-danger);
}

/* ===== Search & Filters ===== */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-box {
  width: 100%;
  position: relative;
}

.search-box input {
  padding-left: 2.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.filter-group select {
  flex: 1;
  min-width: 150px;
}

.filter-group .btn {
  white-space: nowrap;
}

/* ===== Alert ===== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(158, 206, 106, 0.15);
  border: 1px solid var(--accent-success);
  color: var(--accent-success);
}

.alert-danger {
  background: rgba(247, 118, 142, 0.15);
  border: 1px solid var(--accent-danger);
  color: var(--accent-danger);
}

.alert-warning {
  background: rgba(224, 175, 104, 0.15);
  border: 1px solid var(--accent-warning);
  color: var(--accent-warning);
}

.alert-info {
  background: rgba(125, 207, 255, 0.15);
  border: 1px solid var(--accent-info);
  color: var(--accent-info);
}

/* ===== Loading Spinner ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 27, 38, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 999;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* ===== User Info ===== */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-top: auto;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--bg-primary);
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 500;
  color: var(--text-bright);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.4s ease;
}

/* ===== Header Actions ===== */
.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Period Selector ===== */
.period-selector {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--bg-tertiary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.period-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.period-select {
  width: auto;
  padding: 0.4rem 0.75rem;
  min-width: 90px;
}

.period-selector .form-select {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  min-width: auto;
}

.period-selector .form-select:focus {
  border-color: var(--accent-primary);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .page-header > div {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }
  
  .period-selector {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
    padding: 1rem;
  }
  
  .logo-text,
  .nav-text,
  .user-details {
    display: none;
  }
  
  .main-content {
    margin-left: 80px;
  }
  
  .nav-link {
    justify-content: center;
    padding: 0.75rem;
  }
}

@media (max-width: 768px) {
  /* Prevent iOS zoom on focus */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="date"],
  select,
  textarea {
    font-size: 1rem !important;
  }

  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  
  .header-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  .period-selector {
    width: 100%;
    justify-content: space-between;
  }
  
  .filter-group {
    flex-direction: column;
    width: 100%;
  }
  
  .filter-group select,
  .filter-group .btn {
    width: 100%;
  }
  
  .total-display {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .total-item {
    width: 100%;
  }
}

/* ===== Login Page ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 480px) {
  .login-card {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-md);
  }

  .login-logo-icon {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
  }

  .login-title {
    font-size: 1.25rem;
  }
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.login-title {
  font-size: 1.5rem;
  text-align: center;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

/* ===== Status Badges ===== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.status-draft {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.status-submitted {
  background: rgba(125, 207, 255, 0.15);
  color: var(--accent-info);
  border: 1px solid var(--accent-info);
}

.status-approved {
  background: rgba(158, 206, 106, 0.15);
  color: var(--accent-success);
  border: 1px solid var(--accent-success);
}

.status-rejected {
  background: rgba(247, 118, 142, 0.15);
  color: var(--accent-danger);
  border: 1px solid var(--accent-danger);
}

/* ===== Mentor Dashboard ===== */
.mentor-info {
  margin-bottom: 2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-item label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.info-item span {
  color: var(--text-bright);
  font-weight: 500;
}

/* ===== Work Hours Section ===== */
.work-hours-section {
  margin-bottom: 2rem;
}

.report-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.report-status {
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.report-status p {
  margin-bottom: 0.75rem;
}

.reports-history {
  margin-top: 2rem;
}

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.report-item {
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.report-item:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.report-period strong {
  color: var(--text-bright);
}

.report-details {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.report-hours {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.report-comment {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

/* ===== Report Form ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.work-minutes {
  font-family: var(--font-mono);
}

.total-section {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--accent-primary);
}

.total-display {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.total-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.5rem;
}

.total-item label {
  color: var(--text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.total-item strong {
  color: var(--accent-primary);
  font-size: 1.25rem;
  font-weight: 700;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

/* ===== Reports Table (for accountants) ===== */
.filters {
  margin-bottom: 1.5rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.actions {
  margin-bottom: 1.5rem;
}

.stats-section {
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-item label {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.stat-item strong {
  display: block;
  color: var(--accent-primary);
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===== Modal Large ===== */
.modal-large {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  width: 90%;
}

.report-header {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.report-header h3 {
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}

.report-header p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.report-header p strong {
  color: var(--text-bright);
}

.report-section {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.report-section h4 {
  margin-bottom: 1rem;
  color: var(--accent-primary);
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.work-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.work-type-item {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.work-type-item strong {
  color: var(--text-bright);
  margin-right: 0.5rem;
}

.modal-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

/* ===== Modal Info Grid ===== */
.modal-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.info-label {
  min-width: 150px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.info-value {
  flex: 1;
  color: var(--text-bright);
  font-weight: 500;
}

/* ===== Data Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

/* ===== Loading & Messages ===== */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.error {
  padding: 1rem;
  background: rgba(247, 118, 142, 0.15);
  border: 1px solid var(--accent-danger);
  border-radius: var(--radius-md);
  color: var(--accent-danger);
  margin-bottom: 1rem;
}

.success {
  padding: 1rem;
  background: rgba(158, 206, 106, 0.15);
  border: 1px solid var(--accent-success);
  border-radius: var(--radius-md);
  color: var(--accent-success);
  margin-bottom: 1rem;
}

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

/* ===== Pagination Controls ===== */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Container (for standalone pages) ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.header h1 {
  margin: 0;
}

/* ===== Mobile Bottom Navigation ===== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  z-index: 200;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem 0.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.7rem;
  transition: var(--transition);
  border-top: 2px solid transparent;
  min-height: 56px;
}

.mobile-nav-item.active {
  color: var(--accent-primary);
  border-top-color: var(--accent-primary);
}

.mobile-nav-item:hover {
  color: var(--text-bright);
  background: var(--bg-hover);
}

.mobile-nav-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.mobile-nav-label {
  line-height: 1;
  white-space: nowrap;
}

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

  .main-content.has-mobile-nav {
    padding-bottom: calc(1rem + 56px);
  }
}

/* ===== Dashboard Layout with Sidebar ===== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* ===== Sidebar Navigation ===== */
.sidebar-nav {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-bright);
}

.sidebar-menu {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-bright);
}

.menu-item.active {
  background: var(--bg-hover);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
}

.menu-icon {
  font-size: 1.25rem;
  width: 1.5rem;
  text-align: center;
}

.menu-text {
  font-size: 0.9375rem;
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.btn-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ===== Main Dashboard Content ===== */
.main-dashboard {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.mentor-name-display {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.dashboard-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* ===== Content Sections ===== */
.content-section {
  display: none !important;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.content-section.active {
  display: block !important;
  opacity: 1;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive Design for Dashboard ===== */
@media (max-width: 768px) {
  .sidebar-nav {
    width: 70px;
  }
  
  .sidebar-header h2,
  .menu-text {
    display: none;
  }
  
  .menu-item {
    justify-content: center;
    padding: 1rem;
  }
  
  .menu-icon {
    font-size: 1.5rem;
  }
  
  .main-dashboard {
    margin-left: 70px;
  }
  
  .dashboard-header {
    padding: 1rem;
  }
  
  .dashboard-header h1 {
    font-size: 1.25rem;
  }
  
  .dashboard-content {
    padding: 1rem;
  }
  
  .sidebar-footer {
    padding: 0.5rem;
  }
  
  .btn-block .menu-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .sidebar-nav {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    top: auto;
    border-right: none;
    border-top: 1px solid var(--border-color);
    flex-direction: row;
  }
  
  .sidebar-header {
    display: none;
  }
  
  .sidebar-menu {
    display: flex;
    flex: 1;
    padding: 0;
  }
  
  .menu-item {
    flex: 1;
    flex-direction: column;
    padding: 0.75rem 0.5rem;
    gap: 0.25rem;
    border-left: none;
    border-top: 3px solid transparent;
  }
  
  .menu-item.active {
    border-left: none;
    border-top-color: var(--accent-primary);
  }
  
  .menu-icon {
    font-size: 1.5rem;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .main-dashboard {
    margin-left: 0;
    margin-bottom: 70px;
  }
}

/* ===== Activities Section ===== */
.activities-section {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  margin: 0;
}

.filter-section {
  margin-bottom: 2rem;
}

/* ===== Metrics Grid ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Карточки метрик всегда в одну строку */

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.metric-icon {
  font-size: 1.75rem;
  opacity: 0.8;
}

.metric-content {
  flex: 1;
}

.metric-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.125rem;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
}

/* Стили для двухстрочного отображения времени в метриках */
.metric-main {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 400;
}

/* ===== Charts Grid ===== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.chart-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 300px;
}

.chart-full-width {
  grid-column: 1 / -1;
}

/* ===== Detail Table ===== */
.detail-table-section {
  margin-bottom: 2rem;
}

.detail-table-section h3 {
  margin-bottom: 1rem;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.detail-table thead {
  background: var(--bg-tertiary);
}

.detail-table th,
.detail-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.detail-table tbody tr:hover {
  background: var(--bg-hover);
}

/* ===== Activities Table ===== */
.activities-table-section {
  margin-top: 2rem;
}

.activities-table-section h3 {
  margin-bottom: 1rem;
}

.activities-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  overflow: hidden;
}

.activities-table thead {
  background: var(--bg-tertiary);
}

.activities-table th,
.activities-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.activities-table tbody tr {
  transition: var(--transition);
}

.activities-table tbody tr:hover {
  background: var(--bg-hover);
}

.activity-type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-bright);
}

.activity-description {
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-center {
  text-align: center;
}

/* ===== Table Footer ===== */
.table-footer {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-top: 2px solid var(--border-color);
  text-align: right;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pagination-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ===== Modal for Activities ===== */
#activityModal.modal {
  display: none;
  position: fixed;
  z-index: 10000 !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-bright);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ===== Form Elements in Modal ===== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group .required {
  color: var(--accent-danger);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.1);
}

textarea.form-control {
  resize: vertical;
  font-family: var(--font-sans);
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-control-static {
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* ===== Button Icons ===== */
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.btn-icon:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.btn-edit {
  color: var(--accent-info);
}

.btn-edit:hover {
  border-color: var(--accent-info);
  background: rgba(125, 207, 255, 0.1);
}

.btn-delete {
  color: var(--accent-danger);
}

.btn-delete:hover {
  border-color: var(--accent-danger);
  background: rgba(247, 118, 142, 0.1);
}

/* ===== Responsive Design for Activities ===== */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-full-width {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Таблицы: горизонтальный скролл чтобы не ломать layout */
  .activities-table-section,
  .detail-table-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .activities-table,
  .detail-table {
    font-size: 0.875rem;
    min-width: 0;
  }
  
  .activities-table th,
  .activities-table td,
  .detail-table th,
  .detail-table td {
    padding: 0.5rem;
  }
  
  .activity-description {
    max-width: 120px;
  }
  
  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}

/* ===== Period Selector ===== */
.period-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.period-selector label {
  color: var(--text-secondary);
  font-weight: 600;
}

.period-selector select,
.period-selector .form-control {
  min-width: 120px;
}

/* ===== Inline Activity Form ===== */
.add-activity-form {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.add-activity-form h3 {
  margin-bottom: 1.5rem;
  color: var(--text-bright);
  font-size: 1.25rem;
}

.add-activity-form .form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.add-activity-form .form-group {
  margin-bottom: 1rem;
}

.add-activity-form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
}

.add-activity-form .form-group .required {
  color: var(--accent-danger);
}

.add-activity-form .form-control {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
}

.add-activity-form .form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.1);
}

.add-activity-form textarea.form-control {
  resize: vertical;
  font-family: var(--font-sans);
  min-height: 80px;
}

.add-activity-form .form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.add-activity-form .form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .add-activity-form .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  pointer-events: all;
  transform: translateX(400px);
  opacity: 0;
  animation: slideIn 0.3s ease forwards;
}

.toast.hiding {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
}

.toast-content {
  flex: 1;
  color: var(--text-primary);
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-bright);
  font-size: 0.95rem;
}

.toast-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Toast types */
.toast.success {
  border-left: 4px solid var(--accent-success);
}

.toast.success .toast-icon {
  color: var(--accent-success);
}

.toast.error {
  border-left: 4px solid var(--accent-danger);
}

.toast.error .toast-icon {
  color: var(--accent-danger);
}

.toast.warning {
  border-left: 4px solid var(--accent-warning);
}

.toast.warning .toast-icon {
  color: var(--accent-warning);
}

.toast.info {
  border-left: 4px solid var(--accent-info);
}

.toast.info .toast-icon {
  color: var(--accent-info);
}

@media (max-width: 768px) {
  .toast-container {
    bottom: calc(56px + 0.75rem);
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }
  
  .toast {
    min-width: 0;
    width: 100%;
  }
}

/* ===== Dashboard Styles ===== */
/* Дополнительные переменные для дашборда */
:root {
  --primary-color: var(--accent-primary);
  --success-color: var(--accent-success);
  --warning-color: var(--accent-warning);
  --danger-color: var(--accent-danger);
  --info-color: var(--accent-info);
}

/* Статистические карточки дашборда */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent-primary);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Варианты карточек */
.stat-card.warning {
  border-color: var(--warning-color);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(224, 175, 104, 0.05) 100%);
}

.stat-card.warning .stat-card-value {
  color: var(--warning-color);
}

.stat-card.warning::before {
  background: var(--warning-color);
  opacity: 1;
}

.stat-card.danger {
  border-color: var(--danger-color);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(247, 118, 142, 0.05) 100%);
}

.stat-card.danger .stat-card-value {
  color: var(--danger-color);
}

.stat-card.danger::before {
  background: var(--danger-color);
  opacity: 1;
}

.stat-card.success {
  border-color: var(--success-color);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(158, 206, 106, 0.05) 100%);
}

.stat-card.success .stat-card-value {
  color: var(--success-color);
}

.stat-card.success::before {
  background: var(--success-color);
  opacity: 1;
}

/* Панель фильтров */
.filters-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.dashboard-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

/* Таблица дашборда */
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dashboard-table thead {
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.dashboard-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.th-sortable {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.th-sortable:hover {
  color: var(--accent-primary);
}

.sort-icon {
  font-size: 1rem;
  opacity: 0.3;
  transition: var(--transition);
  color: var(--text-muted);
}

.th-sortable:hover .sort-icon {
  opacity: 0.6;
}

.dashboard-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-primary);
}

.dashboard-table tbody tr {
  transition: var(--transition);
  position: relative;
}

.dashboard-table tbody tr:hover {
  background: var(--bg-hover);
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

/* Подсветка истекающих договоров */
.dashboard-table tbody tr.expiring-soon {
  background: linear-gradient(90deg, rgba(224, 175, 104, 0.15) 0%, var(--bg-secondary) 100%);
  border-left: 4px solid var(--warning-color);
}

.dashboard-table tbody tr.expiring-soon:hover {
  background: linear-gradient(90deg, rgba(224, 175, 104, 0.25) 0%, var(--bg-hover) 100%);
}

.dashboard-table tbody tr.expired {
  background: linear-gradient(90deg, rgba(247, 118, 142, 0.15) 0%, var(--bg-secondary) 100%);
  border-left: 4px solid var(--danger-color);
}

.dashboard-table tbody tr.expired:hover {
  background: linear-gradient(90deg, rgba(247, 118, 142, 0.25) 0%, var(--bg-hover) 100%);
}

/* Бейджи статуса */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-badge.warning {
  background: var(--warning-color);
  color: var(--bg-primary);
  box-shadow: 0 2px 8px rgba(224, 175, 104, 0.3);
}

.status-badge.danger {
  background: var(--danger-color);
  color: var(--bg-primary);
  box-shadow: 0 2px 8px rgba(247, 118, 142, 0.3);
}

.status-badge.success {
  background: var(--success-color);
  color: var(--bg-primary);
  box-shadow: 0 2px 8px rgba(158, 206, 106, 0.3);
}

.status-badge.info {
  background: var(--info-color);
  color: var(--bg-primary);
  box-shadow: 0 2px 8px rgba(125, 207, 255, 0.3);
}

/* Пустое состояние */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* Состояние загрузки */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem;
  flex-direction: column;
  gap: 1rem;
}

.spinner {
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Адаптивность для дашборда */
@media (max-width: 1200px) {
  .dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  
  .filters-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-table {
    font-size: 0.75rem;
  }
  
  .dashboard-table th,
  .dashboard-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .stat-card-value {
    font-size: 1.75rem;
  }
}

/* ===== Enhanced Mobile Adaptations ===== */

/* --- Кнопки: минимальный touch-target 44px --- */
@media (max-width: 768px) {
  .btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 36px;
  }

  /* Period selector внутри header-actions занимает всю ширину */
  .header-actions > .period-selector {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-actions > .period-selector .form-select {
    flex: 1;
    min-width: 0;
  }

  /* Compact filters-panel */
  .filters-panel {
    padding: 1rem;
  }

  .filters-panel > div:first-child {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Search input touch target */
  .search-box .form-input,
  .search-box input[type="text"] {
    min-height: 44px;
  }

  /* Metric cards: compact */
  .metric-card {
    padding: 0.75rem 1rem;
    gap: 0.625rem;
  }

  .metric-value,
  .metric-main {
    font-size: 1.25rem;
  }

  .metric-icon {
    font-size: 1.375rem;
  }

  /* Stat cards compact */
  .stat-card {
    padding: 1.25rem;
  }

  /* Stats grid 2 columns на планшете */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Toolbar: search + filters стекаются */
  .toolbar {
    gap: 0.75rem;
  }
}

/* --- Малые телефоны ≤ 480px --- */
@media (max-width: 480px) {
  /* Мобильный навбар: безопасная зона (iPhone notch) */
  .mobile-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav-item {
    min-height: 54px;
    padding: 0.5rem 0.125rem;
    gap: 0.15rem;
  }

  .mobile-nav-icon {
    font-size: 1.125rem;
  }

  .mobile-nav-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  /* Метрики в 1 колонку */
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }

  /* Статистика: 2 колонки на малых экранах */
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .stat-card {
    padding: 1rem;
  }

  /* Заголовок страницы компактнее */
  .page-header h1 {
    font-size: 1.375rem;
  }

  /* Пагинация компактная */
  .pagination-btn,
  .page-btn {
    padding: 0.4rem 0.625rem;
    font-size: 0.8rem;
  }

  /* Модальные окна снизу экрана */
  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 95vh;
    margin-top: auto;
    width: 100%;
    max-width: 100%;
  }

  .modal-overlay.active {
    align-items: flex-end;
  }

  .modal-header,
  .modal-footer {
    padding: 1rem 1.25rem;
  }

  .modal-body {
    padding: 1.25rem;
  }

  /* Форма активностей: 1 колонка */
  .add-activity-form .form-row {
    grid-template-columns: 1fr;
  }

  /* info-row на малых экранах стекается */
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .info-label {
    min-width: unset;
  }
}

/* --- Очень малые экраны ≤ 360px --- */
@media (max-width: 360px) {
  .mobile-nav-label {
    display: none;
  }

  .mobile-nav-item {
    justify-content: center;
  }

  .mobile-nav-icon {
    font-size: 1.25rem;
  }
}

