*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:        #c6a344;
  --gold-hover:  #b8922e;
  --gold-light:  #dfc278;
  --gold-pale:   #faf5e8;
  --gold-pale2:  #f3e9cc;
  --gold-deep:   #7a6120;
  --gold-text:   #6b5318;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --dark:        #111318;
  --dark2:       #181c23;
  --sidebar-fg:  #9aa3b8;
  --sidebar-act: #ffffff;
  --bg:          #f0ede6;
  --surface:     #ffffff;
  --surface2:    #faf8f4;
  --border:      rgba(198,163,68,.18);
  --border-hard: rgba(198,163,68,.32);
  --text:        #1a1810;
  --text2:       #5a5447;
  --text3:       #9a8f7a;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --shadow-md:   0 4px 24px rgba(0,0,0,.08);
  --shadow-gold: 0 6px 24px rgba(198,163,68,.22);
  --transition:  .2s cubic-bezier(.4,0,.2,1);
}

html, body {
  font-family: 'Ubuntu', sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.52);
  z-index: 199;
}
.sidebar-overlay.show { display: block; }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--dark);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-light), var(--gold));
  z-index: 1;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: relative;
}

.brand-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  color: var(--dark);
  box-shadow: 0 4px 14px rgba(198,163,68,.35);
  flex-shrink: 0;
}

.brand-name { font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -.2px; line-height: 1.1; }
.brand-sub  { font-size: 12px; font-weight: 400; color: var(--gold); text-transform: uppercase; letter-spacing: 1.4px; }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 16px;
}
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(198,163,68,.25); border-radius: 3px; }

.nav-section { padding: 14px 0 2px; }
.nav-label {
  padding: 0 20px 5px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(198,163,68,.4);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 20px;
  color: var(--sidebar-fg);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover { color: #e8dfc8; background: rgba(255,255,255,.05); text-decoration: none; }
.nav-item.active { color: #fff; background: rgba(198,163,68,.13); font-weight: 500; text-decoration: none; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}

.nav-item .fa { width: 20px; text-align: center; font-size: 14px; }

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--dark);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.s-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.s-user-info { flex: 1; overflow: hidden; }
.s-user-name { font-size: 13px; font-weight: 500; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-user-role { font-size: 11px; color: var(--sidebar-fg); }

/* ── Topbar ── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 14px;
  z-index: 100;
  transition: left var(--transition);
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.topbar-toggle:hover { background: var(--gold-pale); color: var(--gold-deep); }

.topbar-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.topbar-title small { font-size: 13px; font-weight: 300; color: var(--text3); margin-left: 6px; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 14px;
}
.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-family: 'Ubuntu', sans-serif;
  font-size: 13px;
  color: var(--text);
  width: 170px;
}
.topbar-search .fa { font-size: 13px; color: var(--text3); }
.topbar-search:hover { border-color: var(--border-hard); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.icon-btn:hover { background: var(--gold-pale); border-color: var(--gold); color: var(--gold-deep); text-decoration: none; }
.icon-btn .dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: #e24b4a;
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 2px solid var(--gold-pale2);
}

/* ── Main ── */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.main-inner { padding: 26px 22px; }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 3px;
}
.page-header p { font-size: 13px; color: var(--text3); font-weight: 300; margin: 0; }

/* ── Buttons ── */
.btn-gold {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--gold); color: #fff !important;
  border: none; border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: 0 2px 12px rgba(198,163,68,.3);
  text-decoration: none;
  white-space: nowrap;
}
.btn-gold:hover { background: var(--gold-hover); box-shadow: var(--shadow-gold); transform: translateY(-1px); text-decoration: none; color: #fff; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--gold-text) !important;
  border: 1px solid var(--border-hard); border-radius: var(--radius-sm);
  padding: 6px 13px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-outline:hover { background: var(--gold-pale); text-decoration: none; color: var(--gold-text); }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--transition), transform var(--transition);
  animation: fadeUp .55s ease both;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card:nth-child(1) { animation-delay: .05s; }
.stat-card:nth-child(2) { animation-delay: .10s; }
.stat-card:nth-child(3) { animation-delay: .15s; }
.stat-card:nth-child(4) { animation-delay: .20s; }

.stat-top { display: flex; align-items: flex-start; justify-content: space-between; }

.stat-icon { width: 46px; height: 46px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.ic-gold  { background: var(--gold-pale2); color: var(--gold-deep); }
.ic-green { background: #eaf3de; color: #3b6d11; }
.ic-blue  { background: #e6f1fb; color: #185fa5; }
.ic-red   { background: #fcebeb; color: #a32d2d; }

.stat-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 20px;
}
.t-up   { background: #eaf3de; color: #3b6d11; }
.t-down { background: #fcebeb; color: #a32d2d; }
.t-neu  { background: #faeeda; color: #854f0b; }

.stat-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 11.5px; font-weight: 400; color: var(--text3); text-transform: uppercase; letter-spacing: .8px; margin-top: 1px; }
.stat-sub   { font-size: 12px; color: var(--text3); font-weight: 300; }

/* ── Quick strip ── */
.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  gap: 1px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}
.strip-cell { background: var(--surface); padding: 13px 16px; text-align: center; }
.strip-val  { font-size: 20px; font-weight: 700; color: var(--gold-deep); line-height: 1; }
.strip-lbl  { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: fadeUp .55s ease both;
  margin-bottom: 16px;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card-title .cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }

.card-body { padding: 18px; }
.card-body-sm { padding: 12px 18px; }

/* ── Bar Chart ── */
.chart-area {
  display: flex; align-items: flex-end; gap: 6px; height: 155px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%;
  border-radius: 5px 5px 0 0;
  background: var(--gold-pale2);
  transition: opacity var(--transition);
  cursor: pointer;
}
.bar:hover { opacity: .75; }
.bar.current {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: 0 -3px 14px rgba(198,163,68,.28);
}
.bar-lbl { font-size: 10px; color: var(--text3); font-weight: 500; }
.bar-lbl.curr { color: var(--gold-deep); font-weight: 700; }

.chart-footer {
  display: flex; gap: 18px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); }
.legend-sw { width: 10px; height: 10px; border-radius: 3px; }

/* ── Donut ── */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-legend { flex: 1; }
.dl-item { margin-bottom: 12px; }
.dl-item:last-child { margin-bottom: 0; }
.dl-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dl-label { font-size: 13px; color: var(--text2); flex: 1; }
.dl-pct   { font-size: 13px; font-weight: 700; color: var(--text); }
.dl-track { height: 3px; background: var(--gold-pale2); border-radius: 3px; overflow: hidden; }
.dl-fill  { height: 100%; border-radius: 3px; }

/* ── Table ── */
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table thead th {
  padding: 10px 14px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text3);
  background: var(--gold-pale);
  border-bottom: 1px solid var(--border-hard);
  white-space: nowrap;
}
.dash-table tbody tr { border-bottom: 1px solid rgba(198,163,68,.09); transition: background var(--transition); cursor: pointer; }
.dash-table tbody tr:hover { background: var(--gold-pale); }
.dash-table tbody tr:last-child { border-bottom: none; }
.dash-table tbody td { padding: 11px 14px; font-size: 13px; vertical-align: middle; }

.order-id { font-family: monospace; font-size: 12px; color: var(--text3); }

.product-cell { display: flex; align-items: center; gap: 9px; }
.product-thumb {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gold-pale2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.product-name { font-size: 13px; font-weight: 500; color: var(--text); }
.product-cat  { font-size: 11px; color: var(--text3); }
.amount { font-weight: 700; font-size: 13.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }
.badge-active   { background: #eaf3de; color: #3b6d11; }
.badge-active::before   { background: #3b6d11; }
.badge-pending  { background: #faeeda; color: #854f0b; }
.badge-pending::before  { background: #ef9f27; }
.badge-inactive { background: #fcebeb; color: #a32d2d; }
.badge-inactive::before { background: #e24b4a; }

/* ── Progress ── */
.prog-item { margin-bottom: 15px; }
.prog-item:last-child { margin-bottom: 0; }
.prog-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.prog-label { font-size: 13px; color: var(--text2); }
.prog-val   { font-size: 13px; font-weight: 700; color: var(--gold-deep); }
.prog-track { height: 6px; background: var(--gold-pale2); border-radius: 10px; overflow: hidden; }
.prog-fill  { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--gold-hover), var(--gold), var(--gold-light)); transition: width 1s cubic-bezier(.4,0,.2,1); }

/* ── Feed ── */
.feed-item { display: flex; align-items: flex-start; gap: 11px; padding: 10px 0; border-bottom: 1px solid rgba(198,163,68,.1); }
.feed-item:last-child { border-bottom: none; padding-bottom: 0; }
.feed-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.fi-gold   { background: var(--gold-pale2); color: var(--gold-deep); }
.fi-green  { background: #eaf3de; color: #3b6d11; }
.fi-blue   { background: #e6f1fb; color: #185fa5; }
.fi-orange { background: #faeeda; color: #854f0b; }
.fi-red    { background: #fcebeb; color: #a32d2d; }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-desc  { font-size: 12px; color: var(--text3); font-weight: 300; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time  { font-size: 11px; color: var(--text3); padding-top: 2px; white-space: nowrap; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bootstrap 3 grid overrides */
.row { margin-left: -9px; margin-right: -9px; }
[class*="col-"] { padding-left: 9px; padding-right: 9px; }

/* ── Responsive ── */
@media (max-width: 992px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-search { display: none; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,.35); }
  .topbar { left: 0; padding: 0 14px; }
  .topbar-toggle { display: flex; align-items: center; justify-content: center; }
  .main { margin-left: 0; }
  .main-inner { padding: 18px 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .donut-wrap { flex-direction: column; align-items: center; }
  .donut-legend { width: 100%; }
  .hide-sm { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.modal-header {
  background-color: var(--gold);
  padding: 15px;
  border-bottom: 1px solid #e5e5e5;
  color: #ffffff;
}

.gold-hr {
  border: 1px solid var(--gold);
  margin-top: 10px;
  margin-bottom: 15px;
}

.txtTotales {
  text-align: right;
  font-weight: bold;
  font-size: 18px;
  border-radius: 0px;
  border: 0px;
}
.txtTotales:disabled {
  background-color: var(--gold);
  color: #FFFFFF;
}
