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

body,
button,
input,
select,
textarea {
  font-family: var(--font-body);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-sidebar);
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6, .kpi-value, .card-title {
  font-family: var(--font-heading);
}

.hidden {
  display: none !important;
}

/* Auth Screen */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #282e23 0%, #141614 65%);
  padding: 1.5rem;
}

.auth-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 440px;
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  padding: 2.25rem;
  border: 1px solid var(--border-color);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.65rem;
}

.auth-brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-lime);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main App Shell: Emerald Forest Frame + Rounded Content Sheet */
.app-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-sidebar);
  padding: 14px 14px 14px 0;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  padding-top: 0.35rem;
  padding-bottom: 0.85rem;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
}

.sidebar-header {
  padding: 1.25rem 1.2rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-sidebar);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(13, 46, 33, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-logo:hover {
  transform: scale(1.04);
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-brand-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-sub {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.01em;
  margin-top: 0.08rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1.2rem 0 1.25rem 0.95rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.nav-section-label {
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.085em;
  color: rgba(255, 255, 255, 0.58);
  padding: 0.65rem 0.85rem 0.24rem;
  margin-right: 1.75rem;
}

.nav-section-label:not(:first-child) {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.62rem;
  padding: 0.52rem 0.92rem;
  min-height: 36px;
  border-radius: 26px;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  border: none;
  width: calc(100% - 0.95rem);
  margin-right: 0.95rem;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-item i,
.nav-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.84);
  transition: color 0.18s ease;
}

.nav-item span:not(.nav-badge) {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-item:not(.active):hover i,
.nav-item:not(.active):hover svg {
  color: #ffffff;
}

/* High-Radius Inverted Curved Active Tab Merging Into Main Sheet */
.nav-item.active {
  width: 100%;
  margin-right: 0;
  padding: 0.56rem 1.25rem 0.56rem 0.98rem;
  min-height: 39px;
  background: var(--bg-app);
  color: #065f46;
  font-weight: 600;
  border-radius: 26px 0 0 26px;
  z-index: 2;
}

.nav-item.active::before,
.nav-item.active::after {
  content: "";
  position: absolute;
  right: 0;
  width: 26px;
  height: 26px;
  pointer-events: none;
}

.nav-item.active::before {
  top: -26px;
  background: radial-gradient(circle at 0 0, transparent 26px, var(--bg-app) 26.5px);
}

.nav-item.active::after {
  bottom: -26px;
  background: radial-gradient(circle at 0 100%, transparent 26px, var(--bg-app) 26.5px);
}

.nav-item.active i,
.nav-item.active svg {
  color: #059669;
}

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.62rem;
  padding: 0.08rem 0.44rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.nav-item.active .nav-badge {
  background: var(--accent-lime-soft);
  color: var(--accent-lime-dark);
}

/* Bottom Frosted Workspace Card (Inspired by Reference Support Card) */
.sidebar-footer {
  padding: 0.45rem 0.95rem 0.2rem;
  flex-shrink: 0;
}

.sidebar-support-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 0.72rem 0.85rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.sidebar-support-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.sidebar-support-title {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-support-sub {
  font-size: 0.63rem;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.3;
  margin-top: 0.1rem;
}

.sidebar-support-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  background: #ffffff;
  color: #163d2d;
  border: none;
  font-size: 0.67rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-support-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 46, 33, 0.2);
}

.sidebar-quit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.32rem 0.56rem;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.66rem;
  font-weight: 500;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-quit-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Rounded Main Content Sheet Inside Forest Frame */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: var(--bg-app);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(13, 46, 33, 0.14);
  border: none;
  transition: margin-left 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Desktop Sidebar Collapse Toggle Button */
.sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-collapse-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--bg-sidebar);
}

/* Collapsed Icon-Only Sidebar State (Desktop) */
@media (min-width: 861px) {
  .app-shell.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
  }

  .app-shell.sidebar-collapsed .main-area {
    margin-left: var(--sidebar-collapsed-width);
  }

  .app-shell.sidebar-collapsed .sidebar-header {
    padding: 1.25rem 0 0.75rem;
    justify-content: center;
  }

  .app-shell.sidebar-collapsed .sidebar-brand-wrap {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar-nav {
    padding: 1.15rem 0 1.2rem 0.72rem;
    gap: 0.28rem;
  }

  .app-shell.sidebar-collapsed .nav-section-label {
    height: 1px;
    padding: 0;
    margin: 0.48rem 1.15rem 0.48rem 0.45rem;
    font-size: 0;
    color: transparent;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
  }

  .app-shell.sidebar-collapsed .nav-section-label:first-child {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-item {
    width: calc(100% - 0.72rem);
    margin-right: 0.72rem;
    padding: 0.62rem 0;
    justify-content: center;
    gap: 0;
  }

  .app-shell.sidebar-collapsed .nav-item i,
  .app-shell.sidebar-collapsed .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .app-shell.sidebar-collapsed .nav-item span,
  .app-shell.sidebar-collapsed .nav-badge {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-item.active {
    width: 100%;
    margin-right: 0;
    padding: 0.64rem 0.72rem 0.64rem 0;
    justify-content: center;
    border-radius: 26px 0 0 26px;
  }

  .app-shell.sidebar-collapsed .sidebar-footer {
    padding: 0.45rem 0.72rem 0.25rem;
  }

  .app-shell.sidebar-collapsed .sidebar-support-card {
    padding: 0.55rem 0.4rem;
    align-items: center;
    gap: 0.45rem;
    border-radius: 18px;
  }

  .app-shell.sidebar-collapsed .sidebar-support-top {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar-support-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.42rem;
  }

  .app-shell.sidebar-collapsed .sidebar-support-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
  }

  .app-shell.sidebar-collapsed .sidebar-support-btn span {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar-quit-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    margin-left: 0;
    justify-content: center;
    border-radius: 12px;
  }

  .app-shell.sidebar-collapsed .sidebar-quit-btn span {
    display: none;
  }
}

.topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.topbar-title-wrap {
  min-width: 0;
  flex: 1;
}

.topbar-left #page-title {
  font-size: 1.26rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
  flex-shrink: 0;
}

/* Topbar Account Profile Trigger & Dropdown */
.account-wrapper {
  position: relative;
}

.topbar-account-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.34rem 0.72rem 0.34rem 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.16s ease;
  max-width: 265px;
}

.topbar-account-btn:hover,
.topbar-account-btn.active {
  border-color: var(--border-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.topbar-account-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.topbar-account-btn.active .topbar-account-chevron {
  transform: rotate(180deg);
  color: var(--text-primary);
}

.topbar-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-dark-card);
  color: var(--accent-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid var(--accent-lime);
}

.topbar-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-user-meta {
  min-width: 0;
  text-align: left;
}

.topbar-user-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topbar-user-name {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 115px;
}

.topbar-role-badge {
  background: var(--accent-lime-soft);
  color: var(--accent-lime-dark);
  font-size: 0.62rem;
  padding: 0.1rem 0.45rem;
}

.topbar-user-email {
  font-size: 0.69rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 288px;
  max-width: calc(100vw - 24px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 95;
  overflow: hidden;
  animation: notifDropIn 0.16s ease;
}

.account-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.95rem 1.05rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.account-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-dark-card);
  color: var(--accent-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.92rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid var(--accent-lime);
}

.account-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-dropdown-info {
  min-width: 0;
  flex: 1;
}

.account-dropdown-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.account-dropdown-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-dropdown-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.12rem;
}

.account-dropdown-body {
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.account-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.7rem;
  border-radius: 13px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.account-dropdown-item:hover {
  background: var(--bg-subtle);
}

.account-dropdown-item.active {
  background: rgba(52, 211, 153, 0.12);
}

.account-dropdown-item.active .account-dropdown-item-title {
  color: var(--accent-lime-dark);
}

.account-dropdown-item--danger:hover {
  background: var(--accent-rose-bg);
  color: var(--accent-rose);
}

.account-dropdown-item--danger:hover .account-dropdown-item-title {
  color: var(--accent-rose);
}

.account-dropdown-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-dropdown-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.account-dropdown-item-title {
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.account-dropdown-item-sub {
  font-size: 0.69rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.account-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0.45rem;
}

/* Notification Bell & Dropdown */
.notif-wrapper {
  position: relative;
}

.notif-bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-bell-btn i,
.notif-bell-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  color: var(--text-primary);
}

.notif-bell-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.notif-bell-btn.notif-bell-pulse {
  animation: bellPulse 0.65s ease;
}

@keyframes bellPulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.12) rotate(-10deg); }
  50% { transform: scale(1.12) rotate(10deg); }
  75% { transform: scale(1.06) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.notif-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent-rose, #dc2626);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 390px;
  max-width: calc(100vw - 24px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  overflow: hidden;
  animation: notifDropIn 0.16s ease;
}

@keyframes notifDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-dropdown-header {
  padding: 0.95rem 1.1rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border-color);
}

.notif-dropdown-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.notif-dropdown-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.08rem;
}

.notif-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.notif-filter-btn {
  padding: 0.25rem 0.68rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.notif-filter-btn:hover {
  color: var(--text-primary);
}

.notif-filter-btn.active {
  background: var(--bg-dark-card);
  color: var(--accent-lime);
}

.notif-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notif-list::-webkit-scrollbar {
  width: 5px;
}

.notif-list::-webkit-scrollbar-thumb {
  background: rgba(20, 22, 20, 0.15);
  border-radius: 999px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.72rem;
  padding: 0.82rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--bg-subtle);
}

.notif-item.unread {
  background: rgba(52, 211, 153, 0.06);
}

.notif-item.unread:hover {
  background: rgba(52, 211, 153, 0.12);
}

.notif-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.notif-item-body {
  flex: 1;
  min-width: 0;
}

.notif-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.notif-item-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald, #059669);
  flex-shrink: 0;
}

.notif-item-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.notif-ref-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.08rem 0.4rem;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.notif-dropdown-footer {
  padding: 0.65rem 1.1rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
}

.notif-view-all-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.notif-view-all-btn:hover {
  background: var(--bg-dark-card);
  color: var(--accent-lime);
  border-color: var(--bg-dark-card);
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.5rem;
  cursor: pointer;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.content-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.55rem 2rem 2.5rem;
  width: 100%;
}

.content-container::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.content-container::-webkit-scrollbar-track {
  background: transparent;
}

.content-container::-webkit-scrollbar-thumb {
  background: rgba(20, 22, 20, 0.14);
  border-radius: 999px;
}

.content-container::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 22, 20, 0.26);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
  margin-bottom: 1.35rem;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.35rem;
}

.equal-two-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col-grid, .equal-two-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 8px;
  }
  .sidebar {
    transform: translateX(-105%);
    border-radius: 0 24px 24px 0;
    box-shadow: 18px 0 44px rgba(13, 46, 33, 0.38);
  }
  .sidebar .nav-item.active {
    width: calc(100% - 1.05rem);
    margin-right: 1.05rem;
    border-radius: 999px;
  }
  .sidebar .nav-item.active::before,
  .sidebar .nav-item.active::after {
    display: none;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-area {
    margin-left: 0;
    border-radius: 22px;
  }
  .topbar {
    padding: 0 0.85rem;
    gap: 0.55rem;
  }
  .topbar-left {
    gap: 0.6rem;
  }
  .topbar-left #page-title {
    font-size: 1.06rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #page-subtitle {
    font-size: 0.7rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-user-meta {
    display: none;
  }
  .topbar-account-btn {
    padding: 0.28rem 0.45rem 0.28rem 0.28rem;
  }
  .notif-dropdown {
    right: -46px;
    width: 340px;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .sidebar-collapse-btn {
    display: none;
  }
  .content-container {
    padding: 1.15rem;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html, body {
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  body * { visibility: hidden; }
  .app-shell, .main-area, .content-container {
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #fff !important;
  }
  #print-area, #print-area * {
    visibility: visible;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 210mm !important;
    max-width: 100% !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .quotation-print-sheet {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .no-print { display: none !important; }
}


/* =========================================================
   QR / DEVICE SCANNER BAR & STICKER LABELS
   ========================================================= */
.scanner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 18px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.scanner-bar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 260px;
}

.scanner-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-dark-card);
  color: var(--accent-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scanner-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.scanner-input {
  width: 100%;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.16s ease;
}

.scanner-input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--accent-emerald, #059669);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.28);
}

.qr-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}

.qr-sticker-card {
  border: 1.5px dashed var(--border-strong);
  border-radius: 16px;
  padding: 0.9rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  break-inside: avoid;
}

.qr-sticker-card svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.po-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
  margin-top: 0.25rem;
}

.po-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-emerald, #059669);
  transition: width 0.2s ease;
}

