body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
    transition: background-color 0.3s;
}

.hidden {
    display: none !important;
}

.app-container {
    width: 100%;
    max-width: 900px;
    margin: 20px;
}

/* Стили для входа/регистрации */
.auth-container {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 15px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    outline: none;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

#toggle-auth-mode {
    display: block;
    margin-top: 20px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

/* Стили для основного приложения */
#main-app header {
    background-color: #fff;
    color: #333;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #eee;
}

#logout-button {
    background-color: #dc3545;
    max-width: 100px;
}
#logout-button:hover {
    background-color: #c82333;
}

#main-app main {
    background: #fff;
    padding: 25px;
    border-radius: 0 0 12px 12px;
}

/* --- МОДАЛЬНОЕ ОКНО ДЕТАЛЕЙ ЗАКАЗА --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s;
}
.modal-overlay.hidden {
    display: none !important;
}
.modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    width: 95vw;
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    animation: modal-in 0.2s;
}
@keyframes modal-in {
    from { transform: translateY(-40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 24px 28px;
    border-bottom: 1px solid #eee;
    background: #fafbfc;
    min-height: 56px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    flex: 1;
    text-align: left;
    color: #222;
    line-height: 1.2;
}

.modal-close-btn {
    background: #e9ecef;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 22px;
    text-align: center;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.25s cubic-bezier(.4,2,.6,1);
    margin-left: 24px;
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0;
    /* Чуть поднимаем крестик */
    margin-top: -2px;
}
.modal-close-btn:hover {
    background: #ffb3b3;
    color: #b30000;
    transform: scale(1.12);
    box-shadow: 0 4px 16px rgba(255,0,0,0.12);
}
#modal-body {
    padding: 24px 28px 24px 28px;
    background: #fff;
    color: #222;
}
@media (max-width: 600px) {
    .modal-content {
        max-width: 98vw;
        padding: 0;
    }
    #modal-body {
        padding: 16px 8px;
    }
    .modal-header {
        padding: 12px 8px 12px 16px;
    }
}


/* --- УЛУЧШЕННЫЕ СТИЛИ СПИСКА ЗАКАЗОВ --- */
.order-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    transition: background-color 0.2s;
}
.order-item:hover { background-color: #f8f9fa; }
.order-item:last-child { border-bottom: none; }

.order-item-info {
    display: flex;
    flex-direction: column;
}
.order-item-info b {
    font-size: 16px;
    margin-bottom: 4px;
}
.order-item-info span {
    font-size: 14px;
    color: #666;
}
.order-item-status {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}
.status-open { background-color: #e0f3ff; color: #006ec2; }
.status-in_progress { background-color: #fff8e1; color: #f57f17; }
.status-completed { background-color: #e8f5e9; color: #2e7d32; }


/* Спиннер */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #09f;
    margin: 20px auto;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Стили для кнопок в списках --- */
.order-item button {
    width: auto;      /* Убираем растягивание по ширине */
    padding: 8px 16px; /* Делаем кнопки чуть компактнее */
    font-size: 14px;   /* Уменьшаем шрифт */
    font-weight: 500;
    flex-shrink: 0;   /* Запрещаем кнопке сжиматься, если не хватает места */
    margin-left: 15px; /* Добавляем отступ слева */
}

.order-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.order-actions button {
  min-width: 120px;
  max-width: 200px;
  padding: 10px 24px;
  font-size: 15px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  width: auto;
  display: inline-block;
}
.take-order-btn {
  background: #28a745;
  color: #fff;
}
.take-order-btn:hover { background: #218838; }
.complete-order-btn {
  background: #ffc107;
  color: #212529;
}
.complete-order-btn:hover { background: #e0a800; }

.orders-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 0 0;
}
.orders-page-btn {
    background: #f1f3f6;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.orders-page-btn.active,
.orders-page-btn:hover {
    background: #007bff;
    color: #fff;
}

/* Кнопка завершённых/назад */
#orders-list > button {
    background: #e9ecef;
    color: #007bff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
#orders-list > button:hover {
    background: #007bff;
    color: #fff;
}

/* --- Карточки заказов --- */
.order-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-status {
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.95em;
  color: #fff;
}
.status-open { background: #007bff; }
.status-in_progress { background: #ff9800; }
.status-completed { background: #4caf50; }
.order-info {
  margin-bottom: 6px;
  color: #444;
}