@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
  font-family: Cairo, Arial, sans-serif;
  color: #0f172a;
  background: #f5f7fb;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

#app {
  min-height: 100vh;
}

.shell {
  display: flex;
  min-height: 100vh;
  direction: rtl;
}

.shell aside {
  width: 270px;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  color: #dbeafe;
  background: #071126;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 35px;
}

.brand-mark,
.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #06111f;
  font-size: 22px;
  font-weight: 900;
  background: #19d3b0;
  border-radius: 14px;
}

.brand b {
  display: block;
  color: #fff;
  font-size: 17px;
}

.brand small,
.user small {
  display: block;
  color: #8290a7;
  font-size: 11px;
}

.shell nav {
  display: grid;
  gap: 8px;
}

.shell nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  color: #b6c2d5;
  text-align: right;
  background: transparent;
  border-radius: 13px;
}

.shell nav button:hover,
.shell nav button:first-child {
  color: #6ee7d1;
  background: #12223e;
}

.user {
  margin-top: auto;
  padding: 20px 8px 0;
  border-top: 1px solid #1e2d48;
}

.user b {
  color: #fff;
  font-size: 13px;
}

.link {
  padding: 3px 0;
  color: #008c7e;
  background: transparent;
}

.user .link {
  margin-top: 15px;
  color: #7dd3c5;
  font-size: 12px;
}

.shell main {
  width: calc(100% - 270px);
  max-width: 1500px;
  margin-right: 270px;
  padding: 42px 42px 70px;
}

.shell header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.export-button {
  color: #0f766e;
  border-color: #0f766e;
}

.eyebrow {
  margin: 0;
  color: #008f80;
  font-size: 13px;
  font-weight: 800;
}

.shell h1 {
  margin: 8px 0;
  font-size: 36px;
  line-height: 1.15;
}

.muted {
  margin: 5px 0;
  color: #77849a;
}

.filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #e9fbf7;
  border: 1px solid #c9f2e9;
  border-radius: 18px;
}

.filter-bar div {
  display: grid;
  flex: 0 1 180px;
  min-width: 160px;
  gap: 5px;
}

.filter-bar span {
  color: #087d70;
  font-size: 12px;
  font-weight: 800;
}

.filter-bar input {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  color: #253247;
  background: #fff;
  border: 1px solid #bce7df;
  border-radius: 9px;
}

.filter-bar button {
  min-height: 40px;
  white-space: nowrap;
}

.filter-bar small {
  flex: 1 1 100%;
  color: #5f7d82;
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric,
.card {
  background: #fff;
  border: 1px solid #edf0f5;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .06);
}

.metric {
  min-width: 0;
  min-height: 120px;
  padding: 24px;
  overflow: hidden;
}

.metric span,
.mini-grid span,
.preview-grid span {
  display: block;
  color: #718096;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.metric strong {
  display: block;
  margin-top: 13px;
  font-size: 27px;
  overflow-wrap: anywhere;
}

.green {
  color: #008f80;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 20px;
  margin-bottom: 20px;
}

.period-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.card {
  min-width: 0;
  padding: 28px;
}

.dark {
  color: #fff;
  background: #071126;
  border: 0;
}

.dark .muted,
.dark span {
  color: #aebbd0;
}

.dark strong {
  display: block;
  margin: 10px 0 28px;
  font-size: 34px;
  overflow-wrap: anywhere;
}

.period-card {
  padding: 24px;
}

.period-card p {
  margin: 0;
  color: #dbeafe;
  font-weight: 800;
}

.period-card strong {
  margin: 8px 0 2px;
  color: #19d3b0;
  font-size: 38px;
}

.period-card small {
  display: block;
  color: #aebbd0;
  font-size: 12px;
}

.primary {
  padding: 12px 18px;
  color: #05111e;
  font-weight: 800;
  background: #10c9ad;
  border-radius: 11px;
}

.outline {
  padding: 10px 18px;
  color: #0f172a;
  background: #fff;
  border: 1px solid #0f172a;
  border-radius: 11px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card h2 {
  margin: 0;
  font-size: 18px;
}

.badge {
  padding: 7px 12px;
  color: #008f80;
  font-size: 12px;
  white-space: nowrap;
  background: #e7faf6;
  border-radius: 20px;
}

.mini-grid,
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.preview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-grid div,
.preview-grid div {
  min-width: 0;
  padding: 15px;
  overflow: hidden;
  background: #f8fafc;
  border-radius: 14px;
}

.mini-grid b,
.preview-grid b {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.quantity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.quantity-grid div {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  border: 1px solid #edf0f5;
  border-radius: 14px;
}

.quantity-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quantity-grid strong {
  color: #008f80;
}

.table-wrap {
  width: 100%;
  margin-top: 18px;
  overflow-x: auto;
}

.orders-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px solid #edf0f5;
}

.orders-summary div {
  min-width: 0;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #edf0f5;
  border-radius: 14px;
}

.orders-summary span {
  display: block;
  color: #718096;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.orders-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

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

th,
td {
  padding: 14px 10px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid #edf0f5;
  font-size: 13px;
}

th {
  color: #8a96a8;
  font-weight: 600;
}

.danger {
  color: #e05b64;
}

.empty {
  padding: 45px;
  color: #94a0b0;
  text-align: center;
}

.form-card form {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #65748a;
  font-size: 12px;
  font-weight: 800;
}

.form-card input,
.form-card select,
.item input,
.item select,
.auth input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  color: #253247;
  background: #fff;
  border: 1px solid #e4e8ef;
  border-radius: 10px;
}

.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.four {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 30px;
  align-items: center;
  gap: 8px;
}

.remove {
  color: #b7c0ce;
  font-size: 20px;
  background: transparent;
}

.preview strong {
  display: block;
  margin-top: 10px;
  color: #19d3b0;
  font-size: 34px;
  overflow-wrap: anywhere;
}

.preview-total {
  margin-top: 20px;
  padding: 18px;
  background: #0d1b34;
  border: 1px solid #294262;
  border-radius: 16px;
}

.preview-total span,
.preview-profit span {
  display: block;
  color: #b9c6d8;
  font-size: 13px;
  font-weight: 800;
}

.preview-total strong {
  margin-top: 6px;
  font-size: 30px;
}

.preview-profit strong {
  font-size: 34px;
}

.preview hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid #25344f;
}

.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 10%, #d9fbf3, #f5f7fb 45%);
}

.auth-card {
  width: min(420px, calc(100% - 32px));
  padding: 38px;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 20px 70px rgba(15, 23, 42, .12);
}

.auth-card h1 {
  margin: 10px 0;
  font-size: 30px;
}

.auth-card form {
  display: grid;
  gap: 12px;
  margin-top: 25px;
}

.auth-card .optional {
  display: none;
}

.auth-card .link {
  display: block;
  margin: 18px auto 0;
}

.error {
  min-height: 20px;
  color: #dc535f;
  font-size: 13px;
}

.loading {
  padding: 100px;
  color: #008f80;
  text-align: center;
}

@media (max-width: 1100px) {
  .shell main {
    padding-right: 28px;
    padding-left: 28px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quantity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 950px) {
  .shell aside {
    width: 82px;
    padding: 22px 12px;
  }

  .shell aside .brand div,
  .shell aside nav span,
  .shell aside .user {
    display: none;
  }

  .brand {
    justify-content: center;
    padding: 4px 0 28px;
  }

  .shell nav button {
    justify-content: center;
    font-size: 22px;
  }

  .shell main {
    width: calc(100% - 82px);
    margin-right: 82px;
  }
}

@media (max-width: 620px) {
  .shell aside {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 58px;
    padding: 0 14px;
    flex-direction: row;
  }

  .shell nav {
    display: flex;
    justify-content: space-around;
    width: 100%;
  }

  .shell nav button {
    width: auto;
    padding: 10px 15px;
  }

  .shell main {
    width: 100%;
    margin-right: 0;
    padding: 28px 16px 90px;
  }

  .shell header {
    display: block;
  }

  .shell header > .outline {
    width: 100%;
    margin-top: 16px;
  }

  .header-actions {
    align-items: stretch;
    width: 100%;
    margin-top: 16px;
  }

  .header-actions .outline {
    flex: 1 1 150px;
    width: auto;
    margin-top: 0;
  }

  .filter-bar {
    align-items: stretch;
  }

  .filter-bar div {
    flex: 1 1 130px;
    min-width: 130px;
  }

  .filter-bar button {
    width: 100%;
  }

  .filter-bar small {
    width: 100%;
  }

  .shell h1 {
    font-size: 29px;
  }

  .metrics,
  .period-summary,
  .mini-grid,
  .orders-summary {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 105px;
  }

  .four,
  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 21px;
  }

  .quantity-grid {
    grid-template-columns: 1fr;
  }

  .product-layout,
  .order-layout {
    display: flex;
    flex-direction: column;
  }

  .form-card {
    order: 0;
  }

  .table-wrap {
    margin-right: -5px;
    margin-left: -5px;
  }
}
