* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  background: #eef1f7;
  color: #1f2937;
}

.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 25px 18px;
  background: #fff;
  box-shadow: 18px 0 45px rgba(0, 0, 0, .14);
  z-index: 10;
  animation: sidebarIn .6s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 35px;
  padding: 8px 6px;
}

.brand-icon {
  width: 54px;
  height: 54px;
  background: #e60012;
  color: #fff;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 10px 25px rgba(230, 0, 18, .35);
  animation: iconFloat 2.5s ease-in-out infinite;
}

.brand h2 {
  font-size: 21px;
  line-height: 1.1;
}

.brand p {
  font-size: 13px;
  color: #6b7280;
}

.menu {
  list-style: none;
  display: grid;
  gap: 10px;
}

.menu li {
  position: relative;
  overflow: hidden;
  padding: 15px 16px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: .35s;
  color: #111827;
  font-weight: 700;
}

.menu li i {
  width: 22px;
  text-align: center;
  color: #e60012;
}

.menu li:hover,
.menu li.active {
  background: #e60012;
  color: #fff;
  transform: translateX(7px);
  box-shadow: 0 12px 25px rgba(230, 0, 18, .25);
}

.menu li:hover i,
.menu li.active i {
  color: #fff;
}

/* MAIN */
.main {
  margin-left: 280px;
  width: calc(100% - 280px);
  padding: 28px;
}

.page-section {
  display: none;
  animation: pageIn .45s ease;
}

.page-section.active-page {
  display: block;
}

.hero,
.page-title-box {
  background: linear-gradient(135deg, rgba(0, 0, 0, .94), rgba(230, 0, 18, .88));
  color: #fff;
  border-radius: 28px;
  padding: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  box-shadow: 0 20px 50px rgba(230, 0, 18, .20);
  position: relative;
  overflow: hidden;
}

.hero:after,
.page-title-box:after {
  content: "";
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, .12);
  border-radius: 50%;
  position: absolute;
  right: -70px;
  top: -80px;
  animation: pulse 3s infinite ease-in-out;
}

.hero h1,
.page-title-box h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.hero p,
.page-title-box p {
  color: #f3f4f6;
  position: relative;
  z-index: 2;
}

.btn,
.hero-btn {
  border: 0;
  background: #e60012;
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  transition: .3s;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.hero-btn {
  background: #fff;
  color: #e60012;
}

.btn:hover,
.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, .18);
}

.btn.light {
  background: #f3f4f6;
  color: #111827;
}

/* CARDS */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card,
.panel {
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, .08);
  transition: .35s;
}

.stat-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
  animation: cardUp .7s ease both;
}

.stat-card:before {
  content: "";
  width: 85px;
  height: 85px;
  background: rgba(230, 0, 18, .08);
  position: absolute;
  right: -25px;
  top: -25px;
  border-radius: 50%;
}

.stat-card:hover,
.panel:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(230, 0, 18, .12);
}

.stat-icon {
  width: 52px;
  height: 52px;
  background: #fff1f2;
  color: #e60012;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 22px;
  margin-bottom: 16px;
}

.stat-card h3 {
  font-size: 15px;
  color: #6b7280;
}

.stat-card p {
  font-size: 32px;
  font-weight: 900;
  margin-top: 6px;
}

.grid-2 {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 24px;
}

.dashboard-grid {
  align-items: start;
}

.panel {
  padding: 24px;
  animation: cardUp .65s ease both;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.panel-head h2 {
  font-size: 22px;
}

.panel-head p {
  font-size: 14px;
  color: #6b7280;
  margin-top: 5px;
}

.mini-badge {
  background: #fff1f2;
  color: #e60012;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

/* FORM */
.form-panel {
  position: sticky;
  top: 28px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #4b5563;
  margin-bottom: 7px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  outline: none;
  background: #f9fafb;
  transition: .3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #e60012;
  box-shadow: 0 0 0 4px rgba(230, 0, 18, .08);
  background: #fff;
  transform: translateY(-2px);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* TABLE */
.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
}

th {
  background: #f9fafb;
  color: #4b5563;
  font-size: 13px;
}

td p {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.status {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 800;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  border: 0;
  border-radius: 10px;
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 700;
}

.actions button:first-child {
  background: #dbeafe;
  color: #2563eb;
}

.actions button:last-child {
  background: #fee2e2;
  color: #dc2626;
}

/* HIERARCHY */
.flow-example {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.flow-example span {
  background: #fff1f2;
  color: #e60012;
  padding: 9px 13px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 800;
}

.flow-example i {
  color: #9ca3af;
}

.tree-box {
  display: grid;
  gap: 14px;
}

.tree-main {
  background: #f9fafb;
  border: 1px solid #eef2f7;
  border-radius: 18px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.tree-main:before {
  content: "";
  width: 110px;
  height: 110px;
  background: rgba(230, 0, 18, .06);
  border-radius: 50%;
  position: absolute;
  right: -35px;
  top: -35px;
}

.tree-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.tree-title b {
  background: #e60012;
  color: #fff;
  min-width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 13px;
}

.tree-title h3 {
  color: #e60012;
}

.tree-title h4,
.tree-title h5 {
  color: #111827;
}

.tree-title em {
  font-style: normal;
  color: #6b7280;
  background: #fff;
  border: 1px solid #eef2f7;
  padding: 6px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
}

.tree-cat {
  margin: 14px 0 10px 18px;
  border-left: 3px solid #e60012;
  padding-left: 14px;
  position: relative;
  z-index: 2;
}

.tree-series {
  margin: 12px 0 12px 18px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #eef2f7;
}

.product-chips {
  margin-top: 10px;
}

.product-chips span {
  display: inline-block;
  font-style: normal;
  background: #fff1f2;
  color: #e60012;
  padding: 7px 11px;
  border-radius: 50px;
  margin: 3px;
  font-size: 12px;
  font-weight: 800;
}

.compact-tree .tree-cat {
  margin-bottom: 0;
}

/* ANIMATION */
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .15s; }
.delay-3 { animation-delay: .25s; }
.delay-4 { animation-delay: .35s; }

@keyframes sidebarIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pageIn {
  from { transform: translateY(22px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes cardUp {
  from { transform: translateY(26px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@media(max-width:1100px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }
}

@media(max-width:768px) {
  .admin-wrapper {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .main {
    margin-left: 0;
    width: 100%;
    padding: 18px;
  }

  .hero,
  .page-title-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }

  .flow-example {
    align-items: flex-start;
  }

  table {
    min-width: 760px;
  }
}