:root {
  font-family: "Figtree", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f7f8fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.92), transparent 35%),
    linear-gradient(135deg, #f8f9fc 0%, #f1f3f9 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.6; }
[hidden] { display: none !important; }

/* Shell & Sidebar */
.admin-shell { display: flex; min-height: 100vh; overflow: hidden; }
.admin-sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42));
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 14px 0 40px rgba(27, 39, 61, 0.04);
}
.sidebar-scroll { flex: 1; overflow: auto; padding: 26px 18px 14px; }
.brand-row { display: flex; align-items: center; gap: 11px; padding: 0 8px 30px; }
.brand-row strong { display: block; font-family: "Outfit", sans-serif; color: #172033; font-size: 16px; letter-spacing: 0.14em; }
.brand-row span { display: block; margin-top: 2px; color: #9da5b3; font-size: 9px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #b89060, #725028);
  box-shadow: 0 8px 18px rgba(142, 103, 56, 0.24);
  font-family: "Outfit", sans-serif;
  font-size: 13px;
  font-weight: 700;
}
.mobile-close { display: none; margin-left: auto; border: 0; background: transparent; color: #9da5b3; font-size: 20px; }

.sidebar-nav { display: grid; gap: 16px; }
.nav-section { display: grid; gap: 5px; }
.nav-section > p { margin: 0 13px 4px; color: #a9b0bb; font-size: 9px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #7a8494;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-item:hover { color: #172033; background: rgba(255, 255, 255, 0.65); }
.nav-item.active {
  color: #172033;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 25px rgba(23, 32, 51, 0.06);
}
.nav-icon { width: 20px; color: #a3aab6; font-size: 15px; text-align: center; }
.nav-item.active .nav-icon { color: #9e7b56; }
.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 99px;
  background: #fff0ec;
  color: #b84d38;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-footer {
  padding: 16px 22px 22px;
  border-top: 1px solid rgba(20, 30, 50, 0.06);
  background: rgba(255, 255, 255, 0.28);
}
.sidebar-footer a, .sidebar-footer button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: #7a8494;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
}
.sidebar-footer a:hover, .sidebar-footer button:hover { color: #8e6738; }
.sidebar-footer small { display: block; margin-top: 16px; color: #9aa3b1; font-size: 9.5px; line-height: 1.55; }

/* Main Content & Sticky Topbar */
.admin-main { width: calc(100% - 260px); min-height: 100vh; margin-left: 260px; padding: 0 38px 50px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  background: linear-gradient(180deg, rgba(247, 248, 252, 0.92), rgba(247, 248, 252, 0.72) 75%, transparent);
  backdrop-filter: blur(18px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; }
.topbar-left { gap: 14px; }
.topbar h1 { margin: 0; font-family: "Outfit", sans-serif; color: #172033; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.topbar p { margin: 5px 0 0; color: #9aa3b1; font-size: 11.5px; }
.topbar-right { gap: 12px; }

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 230px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9);
}
.global-search span { color: #a9b0bb; font-size: 15px; }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #263047; font-size: 11.5px; }

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #758091;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 16px rgba(30, 44, 68, 0.04);
  font-size: 16px;
}
.icon-button i {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ef5942;
}
.top-divider { width: 1px; height: 28px; background: rgba(23, 32, 51, 0.08); }
.profile { display: flex; align-items: center; gap: 9px; text-align: right; }
.profile-name { display: flex; flex-direction: column; color: #303b4e; font-size: 11.5px; font-weight: 700; }
.profile-name small { margin-top: 2px; color: #278251; font-size: 9.5px; font-weight: 600; }
.profile-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #172033, #3e4b65);
  font-size: 11px;
  font-weight: 800;
}
.mobile-menu { display: none; border: 0; color: #677386; background: transparent; font-size: 22px; }

.notice-wrap { position: relative; }
.notice-popover {
  position: absolute;
  top: 48px;
  right: 0;
  width: 320px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(22px);
  z-index: 40;
}
.notice-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid rgba(23, 32, 51, 0.07); }
.notice-head b { font-size: 12px; }
.notice-head > span { padding: 4px 8px; border-radius: 99px; color: #b84d38; background: #fff0ec; font-size: 10px; font-weight: 700; }
.notice-item { display: flex; gap: 11px; width: 100%; padding: 12px 18px; border: 0; background: transparent; text-align: left; }
.notice-item:hover { background: #f7f8fb; }
.notice-item i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #8e6738; background: #faf3eb; font-style: normal; flex-shrink: 0; }
.notice-item span { display: grid; gap: 3px; }
.notice-item b { color: #344056; font-size: 11.5px; }
.notice-item small { color: #9aa3b1; font-size: 10px; }

/* Dashboard KPI Cards & Panels */
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric-card, .glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 16px 40px rgba(34, 47, 71, 0.05);
  backdrop-filter: blur(20px);
}
.metric-card { position: relative; min-height: 140px; padding: 18px 20px; border-radius: 21px; overflow: hidden; }
.metric-card:after { position: absolute; right: -25px; bottom: -38px; width: 115px; height: 115px; border-radius: 50%; content: ""; background: rgba(231, 222, 209, 0.28); }
.metric-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: #919aa8; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.metric-top i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #9b7447; background: #faf2e8; font-style: normal; font-size: 13px; }
.metric-card strong { position: relative; z-index: 1; display: block; margin-top: 14px; font-family: "Outfit", sans-serif; color: #253046; font-size: 32px; font-weight: 500; letter-spacing: -0.03em; }
.metric-card small { position: relative; z-index: 1; display: block; margin-top: 3px; color: #a2aab5; font-size: 10.5px; }
.metric-trend { position: relative; z-index: 1; display: inline-block; margin-top: 10px; padding: 4px 8px; border-radius: 99px; color: #8e6738; background: #faf2e8; font-size: 9.5px; font-weight: 700; }
.metric-trend.green { color: #278251; background: #eaf8f0; }
.metric-trend.orange { color: #b45d2a; background: #fff0e8; }

.dashboard-columns { display: grid; grid-template-columns: 1.4fr 0.85fr; gap: 18px; margin-bottom: 18px; }
.glass-panel { border-radius: 24px; }
.hero-panel { padding: 26px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(251, 247, 242, 0.72)); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2 { margin: 4px 0 0; font-family: "Outfit", sans-serif; color: #263148; font-size: 19px; font-weight: 500; }
.panel-heading p { margin: 6px 0 0; color: #8e98a7; font-size: 11.5px; line-height: 1.65; }
.eyebrow { display: block; color: #b0804e; font-size: 9.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.hero-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, #b89060, #725028);
  box-shadow: 0 12px 26px rgba(142, 103, 56, 0.22);
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 24px; }
.quick-actions button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  transition: 0.2s;
}
.quick-actions button:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 11px 24px rgba(23, 32, 51, 0.08); }
.quick-actions button > b { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: #8e6738; background: #faf2e8; font-size: 14px; flex-shrink: 0; }
.quick-actions button > span { display: grid; gap: 3px; min-width: 0; }
.quick-actions strong { color: #39445a; font-size: 11px; }
.quick-actions small { color: #a0a8b4; font-size: 9.5px; }

.activity-panel { padding: 24px; }
.status-dot { padding: 5px 9px; border-radius: 99px; color: #278251; background: #eaf8f0; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; }
.activity-list { display: grid; gap: 15px; margin-top: 18px; }
.activity-list > div { display: flex; align-items: center; gap: 11px; }
.activity-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.activity-icon.green { color: #278251; background: #eaf8f0; }
.activity-icon.orange { color: #b45d2a; background: #fff0e8; }
.activity-list > div > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.activity-list strong { color: #3d485d; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-list small { color: #9ca5b2; font-size: 10px; }
.activity-list time { margin-left: auto; color: #b6bec8; font-size: 9.5px; font-weight: 700; white-space: nowrap; }

/* Content Panels, Toolbars, Tables */
.content-panel { padding: 26px; }
.glass-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.search-field { display: flex; align-items: center; gap: 7px; min-width: 260px; flex: 1; max-width: 360px; height: 38px; padding: 0 13px; border: 1px solid rgba(255, 255, 255, 0.92); border-radius: 999px; background: rgba(255, 255, 255, 0.7); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: #314059; font-size: 11.5px; }
.glass-toolbar select, .field input, .field textarea, .field select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(224, 228, 237, 0.9);
  border-radius: 10px;
  outline: 0;
  color: #354057;
  background: rgba(255, 255, 255, 0.82);
  font-size: 11.5px;
}
.glass-toolbar select:focus, .field input:focus, .field textarea:focus, .field select:focus {
  border-color: #c49a68;
  box-shadow: 0 0 0 3px rgba(184, 144, 96, 0.14);
}
.toolbar-count { margin-left: auto; color: #9aa3b1; font-size: 11px; }

.glass-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  color: #536075;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 7px 18px rgba(23, 32, 51, 0.04);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.glass-action:hover { transform: translateY(-1px); background: #fff; }
.glass-action.primary { color: #fff; background: #1e2430; border-color: #1e2430; box-shadow: 0 9px 18px rgba(30, 36, 48, 0.16); }
.glass-action.primary:hover { background: #3a4353; }
.glass-action.wide { width: 100%; min-height: 46px; }

.table-wrap { overflow: auto; border: 1px solid rgba(224, 228, 237, 0.75); border-radius: 16px; background: rgba(255, 255, 255, 0.5); }
.data-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid rgba(226, 230, 238, 0.75); text-align: left; font-size: 11.5px; vertical-align: middle; }
.data-table th { color: #9ca5b2; background: rgba(250, 251, 253, 0.75); font-size: 9.5px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }

.product-cell { display: flex; align-items: center; gap: 10px; }
.product-thumb-img { width: 42px; height: 32px; border-radius: 8px; object-fit: cover; background: #eae5dc; flex-shrink: 0; }
.product-cell > div { display: grid; gap: 2px; }
.product-cell strong { color: #263148; font-size: 12px; }
.product-cell small { color: #9aa3b1; font-size: 10px; }

.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.status-pill.on { color: #278251; background: #eaf8f0; }
.status-pill.warn { color: #b45d2a; background: #fff0e8; }
.status-pill.off { color: #64748b; background: #f1f5f9; }

.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.icon-action { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 9px; color: #64748b; background: #f1f5fa; font-size: 12px; }
.icon-action:hover { color: #8e6738; background: #faf2e8; }
.icon-action.danger:hover { color: #c3412e; background: #fff0ed; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.category-card { padding: 20px; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 18px; background: rgba(255, 255, 255, 0.62); box-shadow: 0 9px 22px rgba(23, 32, 51, 0.04); }
.category-number { color: #b0804e; font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.category-card h3 { margin: 12px 0 6px; font-family: "Outfit", sans-serif; color: #263148; font-size: 17px; }
.category-card p { margin: 0 0 14px; color: #7a8494; font-size: 11.5px; line-height: 1.6; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(17, 25, 39, 0.36); backdrop-filter: blur(10px); }
.modal { width: min(740px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 26px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-heading h2 { margin: 4px 0 0; font-family: "Outfit", sans-serif; color: #263148; font-size: 20px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 50%; color: #8d97a5; background: #f2f4f7; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #68758a; font-size: 10.5px; font-weight: 800; }
.field textarea { width: 100%; min-height: 86px; padding: 10px 12px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; margin-top: 8px; }

/* Login Screen */
.login-page {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 20px;
  background: radial-gradient(circle at 18% 4%, rgba(255, 255, 255, 0.92), transparent 32%), linear-gradient(135deg, #f9fafc, #eef1f7);
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 42px 36px 36px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 25px 80px rgba(36, 50, 73, 0.08);
  backdrop-filter: blur(30px);
}
.login-orb {
  position: absolute;
  top: -32px;
  left: 50%;
  width: 64px;
  height: 64px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 7px 22px rgba(25, 38, 60, 0.06);
}
.login-orb:after { position: absolute; inset: 19px; border: 2px solid #a47d4c; border-radius: 9px; content: ""; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0 30px; }
.login-brand h1 { margin: 0; font-family: "Outfit", sans-serif; color: #202b40; font-size: 20px; letter-spacing: 0.14em; }
.login-brand p { margin: 3px 0 0; color: #9ca5b2; font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 58px 0 16px;
  border: 1px solid rgba(224, 228, 237, 0.95);
  border-radius: 999px;
  outline: 0;
  color: #39445a;
  background: rgba(255, 255, 255, 0.72);
}
.password-toggle { position: absolute; right: 14px; border: 0; color: #8e6738; background: transparent; font-size: 10.5px; font-weight: 700; }
.status-line { min-height: 18px; margin: 10px 0; font-size: 11px; color: #8d97a5; }
.status-line.success { color: #2b8b59; }
.status-line.error { color: #c3412e; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 14px;
  background: #1e2430;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}

.mobile-scrim { display: none; }
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-columns { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .admin-sidebar.mobile-open { transform: translateX(0); }
  .admin-sidebar.mobile-open ~ .mobile-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(16, 24, 38, 0.2); backdrop-filter: blur(3px); }
  .mobile-close, .mobile-menu { display: block; }
  .admin-main { width: 100%; margin-left: 0; padding: 0 16px 35px; }
  .global-search, .profile-name { display: none; }
  .quick-actions, .form-grid { grid-template-columns: 1fr; }
  .field.full, .modal-actions { grid-column: auto; }
}
