:root {
  --blue-main: #1565c0;
  --blue-dark: #0d47a1;
  --teal: #00897b;
  --green: #2e7d32;
  --orange: #e65100;
  --gray-light: #f5f7fa;
}

body {
  background: var(--gray-light);
  font-family: 'Segoe UI', sans-serif;
}

/* Header */
.app-header {
  background: var(--blue-main);
  color: #fff;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.app-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.app-header .user-info {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Search bar */
.search-bar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 56px;
  z-index: 99;
}
.search-bar .form-control,
.search-bar .btn {
  border-radius: 8px;
}
.search-bar .btn-search {
  background: var(--blue-main);
  color: #fff;
  border: none;
  font-weight: 600;
}
.search-bar .btn-search:hover {
  background: var(--blue-dark);
}

/* Task count badge */
.task-count {
  background: #1976d2;
  color: #fff;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Order card */
.order-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-bottom: 0.85rem;
  overflow: hidden;
  border-left: 4px solid var(--blue-main);
  transition: box-shadow 0.2s;
}
.order-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.order-card.started {
  border-left-color: var(--teal);
}
.order-card.done {
  border-left-color: var(--green);
  opacity: 0.85;
}

.card-body-main {
  padding: 0.9rem 1rem 0.7rem;
}
.order-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.order-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.2rem 0.5rem;
  font-size: 0.78rem;
  color: #555;
}
.order-meta span strong {
  color: #333;
}

/* Badges */
.badge-dem {
  display: inline-block;
  background: #1976d2;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--orange);
}

.yeucau-text {
  font-size: 0.76rem;
  color: #777;
  margin-top: 0.35rem;
  font-style: italic;
}

/* Progress bar */
.progress-mini {
  height: 8px;
  border-radius: 4px;
  background: #e0e0e0;
  margin-top: 0.4rem;
  overflow: hidden;
}
.progress-mini .progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
  transition: width 0.4s ease;
}

/* Action buttons area */
.card-actions {
  padding: 0.5rem 1rem 0.75rem;
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  border-top: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.btn-start {
  background: var(--blue-main);
  color: #fff;
  border: none;
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  font-weight: 600;
}
.btn-start:hover { background: var(--blue-dark); color: #fff; }
.btn-start:disabled { background: #bbb; cursor: not-allowed; }

.btn-progress {
  background: var(--teal);
  color: #fff;
  border: none;
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  font-weight: 600;
}
.btn-progress:hover { background: #00695c; color: #fff; }

.btn-complete {
  background: var(--orange);
  color: #fff;
  border: none;
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  font-weight: 600;
}
.btn-complete:hover { background: #bf360c; color: #fff; }

.btn-done-label {
  background: var(--green);
  color: #fff;
  border: none;
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  font-weight: 600;
  cursor: default;
}

/* Modal */
.modal-progress .modal-header {
  background: var(--teal);
  color: #fff;
}
.modal-progress .modal-title { font-weight: 700; }
.modal-progress .btn-close { filter: invert(1); }

.progress-value-display {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--teal);
  text-align: center;
  line-height: 1;
}
.progress-label {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}
input[type=range] {
  accent-color: var(--teal);
  width: 100%;
  height: 8px;
  cursor: pointer;
}

/* Loading & empty state */
.spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
  color: var(--blue-main);
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #aaa;
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 0.5rem; }

/* Responsive */
@media (max-width: 576px) {
  .order-meta { grid-template-columns: 1fr 1fr; }
  .search-bar { top: 52px; }
  .app-header h1 { font-size: 1rem; }
}
