:root {
  --primary: #4d6df7;
  --bg: #f5f7fb;
  --panel: #fff;
  --line: #e7ebf4;
  --text: #1f2430;
  --muted: #7b8190;
  --danger: #d94841;
  --success: #1f9d66;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  background: #172033;
  color: #fff;
}

.brand {
  margin: 8px 0 24px;
  font-size: 22px;
  font-weight: 800;
}

.sidebar button {
  display: block;
  width: 100%;
  height: 40px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 8px;
  color: rgba(255,255,255,.82);
  background: transparent;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.sidebar button.active,
.sidebar button:hover {
  color: #fff;
  background: rgba(77,109,247,.8);
}

.main {
  padding: 28px;
}

.login-card {
  max-width: 420px;
  margin: 12vh auto;
  padding: 28px;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(23,32,51,.12);
}

.login-card h1 {
  margin: 0 0 10px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.7;
}

.login-card label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
}

.login-card input {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.login-card button,
.topbar button,
.action,
.form button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

.form button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.workspace.hidden,
.hidden {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
}

.stat,
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.stat {
  padding: 18px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.panel {
  margin-top: 16px;
  padding: 18px;
}

.inline-panel {
  margin-bottom: 16px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  background: #fafbff;
}

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #edf1ff;
}

.tag {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: #edf1ff;
  color: var(--primary);
  font-size: 12px;
}

.tag.neutral {
  background: #f0f2f7;
  color: var(--muted);
}

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

.booking-summary {
  display: grid;
  gap: 4px;
  min-width: 120px;
}

.booking-summary strong {
  color: var(--primary);
}

.booking-summary span {
  color: var(--muted);
  font-size: 12px;
}

.status {
  color: var(--primary);
  font-weight: 700;
}

.status.approved,
.status.completed,
.status.paid {
  color: var(--success);
}

.status.rejected,
.status.cancelled {
  color: var(--danger);
}

.form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbff;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form input,
.form select,
.form textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
}

.form textarea {
  resize: vertical;
}

.wide {
  grid-column: span 2;
}

.inline-check {
  justify-content: center;
}

.inline-check input {
  min-height: auto;
}

.hours-field {
  color: var(--muted);
  font-size: 13px;
}

.field-title {
  margin-bottom: 8px;
}

.hour-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(76px, 1fr));
  gap: 8px;
}

.service-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.check-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text) !important;
}

.check-chip input {
  min-height: auto;
}

.empty {
  padding: 60px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  #app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  .brand {
    white-space: nowrap;
    margin: 8px 12px 8px 0;
  }
  .sidebar button {
    width: auto;
    white-space: nowrap;
  }
  .cards,
  .form {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: span 1;
  }
}
