* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --card-2: #21252e;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #f5b800;
  --accent-2: #ffd24a;
  --border: #2a2e37;
  --radius: 14px;
  --danger: #f87171;
  --ok: #34d399;
}
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.screen { min-height: 100vh; }

/* ===== Логин ===== */
#loginScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.02em; margin-bottom: 20px; }
.logo span { color: var(--accent); }
.logo.small { font-size: 16px; margin: 0; }
.login-box h1 { font-size: 22px; margin-bottom: 20px; }
.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.field {
  width: 100%;
  padding: 12px 14px;
  margin-top: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0b0d12;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,184,0,.15);
}
textarea.field { resize: vertical; }

.btn-primary {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius);
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245,184,0,.4);
}
.btn-ghost {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.btn-ghost:hover { border-color: var(--accent); }
.btn-ghost.small { padding: 6px 10px; font-size: 12px; }
.msg { margin-top: 10px; font-size: 14px; }

/* ===== Кабинет ===== */
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: rgba(15,17,21,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header-left { display: flex; align-items: center; gap: 12px; }
.master-name { font-size: 13px; color: var(--muted); }
.app-main { padding: 20px 16px 40px; max-width: 900px; margin: 0 auto; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; letter-spacing: -.02em; }

.orders-list { display: flex; flex-direction: column; gap: 14px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 15px; }

.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .15s ease;
}
.order-card:hover { border-color: rgba(245,184,0,.35); }
.order-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 8px;
}
.order-title { font-weight: 700; font-size: 16px; }
.order-price { color: var(--accent); font-weight: 800; white-space: nowrap; }
.order-desc { color: var(--muted); font-size: 14px; margin-bottom: 8px; line-height: 1.45; }
.order-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.order-meta a { color: #60a5fa; text-decoration: none; }
.order-meta a:hover { text-decoration: underline; }
.order-photo img { max-width: 100%; border-radius: 10px; margin-bottom: 12px; display: block; }
.order-actions { display: flex; gap: 10px; }
.order-actions .btn-primary { width: auto; flex: 1; margin: 0; }

/* ===== Модалка ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 100;
  overflow-y: auto;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.modal-box h3 { font-size: 18px; margin-bottom: 6px; }
.modal-note { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn-ghost { flex: 0 0 auto; }
.modal-actions .btn-primary { flex: 1; margin: 0; }

@media (max-width: 480px) {
  .app-header { padding: 12px; }
  .master-name { font-size: 12px; }
  .app-main { padding: 16px 12px 32px; }
  .order-card { padding: 14px; }
}
/* два блока */
.orders-section { margin-bottom: 28px; }
.count-badge {
  display: inline-block;
  background: var(--accent);
  color: #111;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* «Мои заказы» — визуально выделены */
.order-card--my {
  border-color: rgba(245,184,0,.45);
  background: linear-gradient(180deg, #221c0a 0%, var(--card) 100%);
}
.order-card--my::before {
  content: "Ваш заказ";
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.app-header-right { display: flex; align-items: center; gap: 10px; }
.online-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); cursor: pointer;
  user-select: none;
}
.online-toggle input { display: none; }
.online-toggle .online-label::before {
  content: "";
  display: inline-block;
  width: 34px; height: 20px;
  background: #2a2e37;
  border-radius: 10px;
  position: relative;
  transition: background .2s ease;
  margin-right: 6px;
  vertical-align: middle;
}
.online-toggle .online-label::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  left: 2px; top: 2px;
  transition: transform .2s ease;
}
.online-toggle input:checked + .online-label::before { background: var(--accent); }
.online-toggle input:checked + .online-label::after { transform: translateX(14px); }
.online-toggle input:checked + .online-label { color: var(--accent); }

/* ===== Выполненные (серые, потухшие) ===== */
.order-card--done {
  opacity: .55;
  background: #14161a;
  border-color: #20232a;
  cursor: default;
}
.order-card--done:hover {
  border-color: #20232a;
  transform: none;
  box-shadow: none;
}
.order-card--done .order-title { color: var(--muted); }
.order-card--done .order-price { color: var(--muted); }
.order-card--done .order-desc,
.order-card--done .order-meta { color: #5b616b; }
.order-card--done .order-photo img { filter: grayscale(1); opacity: .6; }
.order-card--done a { color: #5b616b; }
.order-done-badge {
  display: inline-block;
  padding: 8px 12px;
  background: rgba(52,211,153,.06);
  border: 1px solid rgba(52,211,153,.15);
  color: rgba(52,211,153,.55);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  width: 100%;
}
.count-badge--muted {
  background: #2a2e37;
  color: var(--muted);
}