:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2a44;
  --primary: #3a6ff8;
  --success: #1ea672;
  --danger: #dd3f4f;
  --border: #dbe3ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(120deg, #edf3ff 0%, #f8f6ff 100%);
  color: var(--text);
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(31, 42, 68, 0.08);
  padding: 16px;
  margin-bottom: 16px;
}

.login-card {
  max-width: 460px;
  margin: 40px auto;
}

.subtitle {
  margin-top: -8px;
  color: #4f618a;
}

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

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.two-col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.required-dot {
  color: #d11f35;
  font-weight: 800;
}

.optional-text {
  color: #5b6f97;
  font-weight: 600;
  font-size: 12px;
}

input,
select,
textarea {
  border: 1px solid #c9d7ea;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 111, 248, 0.12);
}

.button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

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

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: #e7eefb;
  color: #1f2a44;
  font-weight: 700;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.success {
  background: var(--success);
  color: #fff;
}

.btn.secondary {
  background: #6c7ae0;
  color: #fff;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn:hover {
  opacity: 0.92;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.sales-graph {
  padding: 0;
  margin-top: 16px;
}

.sales-graph .graph-card {
  background: #f8faff;
  border: 1px solid #dce9ff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.sales-graph table {
  margin-bottom: 0;
}

.sales-graph .growth-bar {
  display: inline-block;
  height: 12px;
  border-radius: 999px;
  background: #3a6ff8;
}

.hidden {
  display: none;
}

.error {
  color: var(--danger);
  min-height: 18px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  font-size: 14px;
}

th {
  color: #41557f;
  background: #f2f6ff;
}

.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.product-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f6f9ff;
}

.image-preview {
  min-height: 44px;
  border: 1px dashed #b8c8df;
  border-radius: 10px;
  padding: 10px;
  color: #5b6f97;
  background: #f8fbff;
}

.product-preview {
  max-width: 160px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.section-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stats p {
  margin: 8px 0;
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 19, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(92vw, 360px);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(13, 32, 74, 0.25);
}

.tick {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 4px auto 10px;
  font-size: 38px;
  line-height: 64px;
  color: #fff;
  background: var(--success);
  font-weight: 800;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.profile-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f9fbff;
}

.payment-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.payment-summary .block {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f4f8ff;
  font-size: 14px;
}

.payment-summary .block h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #41557f;
}

.payment-summary .block p {
  margin: 4px 0;
}

@media (max-width: 760px) {
  #app {
    padding: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
