:root {
  --admin-primary: #ef1733;
  --admin-dark: #20171c;
  --admin-bg: #f4f5f8;
  --admin-muted: #78808c;
}

* {
  box-sizing: border-box;
}

body {
  color: #29252a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

a,
a:hover {
  text-decoration: none;
}

.btn-primary {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: #cd1028;
  background: #cd1028;
}

.admin-body {
  min-height: 100vh;
  background: var(--admin-bg);
}

.admin-topbar {
  position: fixed;
  z-index: 1050;
  top: 0;
  right: 0;
  left: 0;
  height: 72px;
  padding: 0 24px;
  background: var(--admin-dark);
}

.admin-topbar .navbar-brand img {
  width: 70px;
  height: 48px;
  margin-right: 12px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
}

.admin-topbar .navbar-brand span {
  font-size: 17px;
  font-weight: 600;
}

.admin-layout {
  display: flex;
  padding-top: 72px;
}

.admin-sidebar {
  position: fixed;
  top: 72px;
  bottom: 0;
  left: 0;
  width: 235px;
  padding: 24px 14px;
  background: #fff;
  border-right: 1px solid #e7e7ea;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  margin-bottom: 7px;
  color: #57515a;
  border-radius: 8px;
  font-weight: 600;
}

.admin-sidebar a i {
  width: 28px;
  font-size: 19px;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--admin-primary), #ff4962);
}

.admin-content {
  width: calc(100% - 235px);
  min-height: calc(100vh - 72px);
  margin-left: 235px;
  padding: 32px;
}

.admin-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.admin-page-heading small {
  color: var(--admin-primary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .8px;
}

.admin-page-heading h1 {
  margin: 3px 0 0;
  font-size: 28px;
  font-weight: 700;
}

.stat-card,
.admin-card {
  overflow: hidden;
  border: 1px solid #ececf0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(28, 21, 25, .045);
}

.stat-card {
  display: flex;
  align-items: center;
  min-height: 116px;
  padding: 22px;
}

.stat-icon {
  display: flex;
  flex: 0 0 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  border-radius: 12px;
  font-size: 25px;
}

.stat-icon.purple { color: #7449d7; background: #eee8ff; }
.stat-icon.blue { color: #2584d8; background: #e6f3ff; }
.stat-icon.orange { color: #df7a13; background: #fff0df; }
.stat-icon.green { color: #21965a; background: #e4f9ed; }

.stat-card small,
.stat-card strong {
  display: block;
}

.stat-card small {
  color: var(--admin-muted);
  font-size: 12px;
}

.stat-card strong {
  margin-top: 4px;
  font-size: 25px;
}

.admin-card-header {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #ededf1;
}

.admin-card-header h2,
.form-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.admin-table th {
  padding: 13px 16px;
  color: #77717a;
  border-top: 0;
  border-bottom: 1px solid #eee !important;
  background: #fafafa;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .45px;
}

.admin-table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-top: 1px solid #f0f0f2;
}

.status-badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pending { color: #b36c00; background: #fff1d6; }
.status-confirmed { color: #1768aa; background: #e2f1ff; }
.status-shipped { color: #6547bf; background: #eee9ff; }
.status-delivered { color: #13713f; background: #ddf7e9; }
.status-cancelled { color: #af2635; background: #ffe1e5; }

.low-stock-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  color: #29252a;
  border-bottom: 1px solid #eee;
}

.low-stock-list a:last-child {
  border-bottom: 0;
}

.low-stock-list strong,
.low-stock-list small {
  display: block;
}

.low-stock-list small {
  margin-top: 3px;
  color: var(--admin-muted);
}

.admin-search {
  display: flex;
}

.admin-search .form-control {
  width: 280px;
}

.admin-search .btn {
  margin-left: 6px;
}

.admin-product {
  display: flex;
  min-width: 260px;
  align-items: center;
}

.admin-product img {
  width: 50px;
  height: 58px;
  margin-right: 12px;
  border-radius: 5px;
  object-fit: cover;
}

.admin-product strong,
.admin-product small {
  display: block;
}

.admin-product small {
  margin-top: 3px;
  color: var(--admin-muted);
}

.form-section-title {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
}

.form-control {
  min-height: 44px;
  border-color: #dddde2;
  border-radius: 5px;
}

textarea.form-control {
  min-height: auto;
}

.image-preview {
  display: flex;
  height: 280px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  color: #9a939b;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: #fafafa;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview i {
  margin-bottom: 8px;
  font-size: 50px;
}

.order-item-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.order-item-row img {
  width: 58px;
  height: 68px;
  border-radius: 5px;
  object-fit: cover;
}

.order-item-row strong,
.order-item-row small {
  display: block;
}

.order-item-row small {
  margin-top: 4px;
  color: var(--admin-muted);
}

.order-totals {
  max-width: 390px;
  padding: 20px;
  margin-left: auto;
}

.order-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
}

.order-totals .grand-total {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #ddd;
  font-size: 18px;
}

.admin-login-body {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 25px;
  background:
    linear-gradient(rgba(23, 13, 19, .82), rgba(23, 13, 19, .82)),
    url('/img/banner-2.jpeg') center/cover;
}

.admin-login-card {
  width: 100%;
  max-width: 430px;
  padding: 38px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.login-logo {
  display: block;
  text-align: center;
}

.login-logo img {
  width: 135px;
  height: 80px;
  object-fit: contain;
}

.admin-login-card h1 {
  margin: 20px 0 8px;
  text-align: center;
  font-size: 27px;
  font-weight: 700;
}

.admin-login-card > p {
  margin-bottom: 25px;
  color: var(--admin-muted);
  text-align: center;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 48px;
}

.password-field button {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border: 0;
  color: #777;
  background: transparent;
}

.back-store {
  display: block;
  margin-top: 22px;
  color: #555;
  text-align: center;
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    width: 74px;
    padding: 20px 9px;
  }

  .admin-sidebar a {
    justify-content: center;
    padding: 13px;
    font-size: 0;
  }

  .admin-sidebar a i {
    width: auto;
    font-size: 21px;
  }

  .admin-content {
    width: calc(100% - 74px);
    margin-left: 74px;
    padding: 22px;
  }
}

@media (max-width: 575.98px) {
  .admin-topbar {
    height: 62px;
    padding: 0 12px;
  }

  .admin-topbar .navbar-brand img {
    width: 55px;
    height: 40px;
  }

  .admin-topbar .navbar-brand span,
  .admin-topbar .btn-outline-light {
    display: none;
  }

  .admin-layout {
    padding-top: 62px;
  }

  .admin-sidebar {
    z-index: 1030;
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 62px;
    padding: 6px;
    border-top: 1px solid #ddd;
    border-right: 0;
  }

  .admin-sidebar nav {
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .admin-sidebar a {
    flex: 0 0 62px;
    margin: 0;
  }

  .admin-content {
    width: 100%;
    margin: 0;
    padding: 16px 12px 82px;
  }

  .admin-page-heading {
    align-items: flex-start;
  }

  .admin-page-heading h1 {
    font-size: 23px;
  }

  .admin-page-heading .btn,
  .admin-page-heading form {
    margin-left: 10px;
  }

  .admin-search .form-control {
    width: 180px;
  }

  .order-item-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .order-item-row .flex-grow-1 {
    width: calc(100% - 75px);
  }

  .admin-login-card {
    padding: 28px 22px;
  }
}
