:root {
  --primary: #1d4ed8;
  --accent: #14b8a6;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
  --radius: 18px;
  --sidebar-width: 280px;
  --sidebar-collapsed: 88px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  min-height: 100vh;
  display: flex;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  transition:
    width 0.25s ease,
    left 0.25s ease;
  z-index: 50;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .brand-info,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-sublink span,
.sidebar.collapsed .mini-user-text,
.sidebar.collapsed .logout-btn span,
.sidebar.collapsed .chevron {
  display: none;
}

.sidebar.collapsed .nav-submenu {
  display: none !important;
}

.sidebar-top {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  flex-shrink: 0;
}

.brand-name {
  font-weight: 900;
  font-size: 15px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: #f1f5f9;
  border-radius: 12px;
  cursor: pointer;
}

.sidebar-scroll {
  padding: 14px 10px;
  overflow-y: auto;
  flex: 1;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 900;
  margin: 14px 12px 6px;
}

.nav-link,
.nav-dropdown-toggle,
.nav-sublink {
  text-decoration: none;
  color: var(--text);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.nav-link,
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 800;
  transition: 0.2s ease;
}

.nav-link-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link i,
.nav-dropdown-toggle i,
.nav-sublink i {
  width: 18px;
  text-align: center;
}

.nav-link:hover,
.nav-dropdown-toggle:hover {
  background: #eff6ff;
  color: var(--primary);
}

.nav-link.active {
  background: rgba(29, 78, 216, 0.12);
  color: var(--primary);
}

.nav-group.open > .nav-dropdown-toggle {
  background: rgba(29, 78, 216, 0.1);
  color: var(--primary);
}

.chevron {
  transition: transform 0.2s ease;
}

.nav-group.open .chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  padding: 6px 0 4px 12px;
}

.nav-group.open .nav-submenu {
  display: block;
}

.nav-sublink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin: 4px 0;
}

.nav-sublink:hover {
  background: #f8fafc;
  color: var(--primary);
}

.nav-sublink.active {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: 14px;
}

.mini-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.mini-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

.mini-name {
  font-weight: 900;
  font-size: 14px;
}

.mini-role {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.logout-btn {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  text-decoration: none;
  padding: 12px;
  border-radius: 14px;
  font-weight: 800;
  color: #991b1b;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

/* MAIN */
.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-heading {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.breadcrumb {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: rgba(29, 78, 216, 0.1);
  color: var(--primary);
}

.topbar-name {
  font-weight: 800;
  font-size: 14px;
}

.topbar-role {
  font-size: 12px;
  color: var(--muted);
}

.content {
  padding: 20px 18px 40px;
}

.mobile-only {
  display: none;
}
.desktop-only {
  display: inline-flex;
}

/* PANEL / TABLE / BUTTON BASE */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #fff;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

th {
  border-top: none;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  text-transform: lowercase;
}

.status.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}
.status.processing {
  background: rgba(29, 78, 216, 0.1);
  color: #1e40af;
}
.status.delivered {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}
.status.failed {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
}
.status.cancelled {
  background: rgba(100, 116, 139, 0.12);
  color: #334155;
}
.status.refunded {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}
.status.resolved {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

/* MOBILE */
@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    height: 100vh;
    width: 280px;
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-only {
    display: inline-flex;
  }
  .desktop-only {
    display: none;
  }

  .topbar {
    padding: 14px;
  }

  .page-heading {
    font-size: 18px;
  }
}

.mobile-menu-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:hover {
  background: #f8fafc;
}



