/* ============================================================================
 * SMARTAPJ LNS — ENTERPRISE ORANGE & WHITE GRADIENT SAAS DESIGN SYSTEM
 * ============================================================================ */

:root {
  --brand-orange: #f97316;
  --brand-orange-dark: #ea580c;
  --brand-orange-deep: #c2410c;
  --brand-orange-soft: #fff7ed;
  --brand-orange-border: #fed7aa;
  --brand-gradient: linear-gradient(135deg, #ff6b00 0%, #f97316 50%, #ea580c 100%);
  --brand-gradient-subtle: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);

  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-std: #e2e8f0;

  --control-height: 40px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
  --shadow-orange: 0 6px 18px rgba(249, 115, 22, 0.24);

  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: transparent;

  color-scheme: light;
  accent-color: var(--brand-orange);
}

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

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  text-wrap: balance;
  color: var(--text-main);
}

code {
  word-break: break-all;
}

.hidden {
  display: none !important;
}

.scroller {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

@supports not (scrollbar-color: auto) {
  .scroller::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  .scroller::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
  }
}

/* ============================================================================
 * DOWNWARD HOVER "i" TOOLTIP COMPONENT (NEVER CLIPS ON TOP HEADER)
 * ============================================================================ */
.title-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: wrap;
}

.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  border: 1px solid var(--brand-orange-border);
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: help;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.info-tip:hover,
.info-tip:focus-visible {
  background: var(--brand-gradient);
  color: #ffffff;
  border-color: var(--brand-orange-dark);
  outline: none;
}

/* Panah kecil mengarah ke atas (karena baloon muncul di bawah ikon) */
.info-tip::before {
  content: "";
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 5px 6px 5px;
  border-style: solid;
  border-color: transparent transparent #0f172a transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 10000;
}

/* Baloon informasi muncul ke arah bawah-samping sehingga tidak pernah tertutup header */
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 9px);
  left: -8px;
  transform: translateY(-4px);
  width: max-content;
  max-width: min(260px, 76vw);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  background: #0f172a;
  color: #ffffff;
  border-left: 3px solid var(--brand-orange);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 9999;
  text-align: left;
  white-space: normal;
}

.kpi-head .info-tip::after {
  left: auto;
  right: -6px;
}

.info-tip:hover::before,
.info-tip:focus-visible::before,
.info-tip:hover::after,
.info-tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.info-tip:hover::before,
.info-tip:focus-visible::before {
  transform: translateX(-50%);
}

/* ============================================================================
 * 1. LOGIN VIEW (ORANGE & WHITE GRADIENT)
 * ============================================================================ */
.login-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 107, 0, 0.14), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(234, 88, 12, 0.12), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--brand-orange-border);
  border-top: 4px solid var(--brand-orange);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(234, 88, 12, 0.1);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.brand-logo-lg {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-orange);
  flex-shrink: 0;
}

.login-brand h1 {
  font-size: 1.2rem;
  font-weight: 800;
}

.login-brand p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.quick-demo-box {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border-std);
}

.quick-demo-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.demo-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.pill-btn {
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-orange-border);
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--brand-gradient);
  color: #ffffff;
  border-color: transparent;
}

/* ============================================================================
 * 2. MODERN ENTERPRISE SIDEBAR & MOBILE DRAWER BACKDROP
 * ============================================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  position: relative;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 190;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
  border-right: 1px solid var(--border-std);
  padding: 1.25rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 60;
  overflow-y: auto;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.25rem 0.45rem 1.15rem;
  border-bottom: 1px solid var(--border-std);
}

.brand-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.btn-close-drawer {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-orange-border);
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  font-size: 0.95rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-close-drawer:hover {
  background: var(--brand-gradient);
  color: #ffffff;
  border-color: transparent;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--brand-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 14px rgba(249, 115, 22, 0.28);
  flex-shrink: 0;
}

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

.brand-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.71rem;
  color: var(--brand-orange-dark);
  font-weight: 600;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.85rem;
}

.nav-section-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.3rem;
}

.nav-btn {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0 0.85rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}

.nav-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.16s ease, transform 0.16s ease;
}

.nav-btn:hover {
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  border-color: rgba(254, 215, 170, 0.6);
}

.nav-btn:hover .nav-svg {
  color: var(--brand-orange);
  transform: translateX(1px);
}

.nav-btn.active {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.26);
}

.nav-btn.active .nav-svg {
  color: #ffffff;
}

.sidebar-footer {
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-std);
  margin-top: 1rem;
}

.health-box {
  background: #ffffff;
  border: 1px solid var(--brand-orange-border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: var(--shadow-sm);
}

.health-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-main);
}

.health-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-left: 1.05rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* ============================================================================
 * 3. TOP NAVBAR & MAIN CONTENT
 * ============================================================================ */
.main-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.top-navbar {
  min-height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-std);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  max-width: 100%;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.navbar-left h2 {
  font-size: 1.12rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-std);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex-wrap: wrap;
}

.navbar-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vendor-filter-box {
  min-width: 0;
}

.vendor-filter-box select {
  min-width: 185px;
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.35rem 0.25rem 0.55rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-std);
  min-width: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.user-meta strong {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta span {
  font-size: 0.68rem;
  color: var(--brand-orange-dark);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-area {
  padding: 1.35rem;
  max-width: 1440px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

/* ============================================================================
 * 4. UNIFORM FORMS, FILTER BARS, INPUTS, SELECTS & BUTTONS
 * ============================================================================ */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: end;
  min-width: 0;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.field-full {
  grid-column: 1 / -1;
}

.form-btn-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.template-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.template-actions a {
  text-decoration: none;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border-std);
  min-width: 0;
}

.field-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="file"],
select {
  height: var(--control-height);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-std);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 0.84rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="file"] {
  padding: 0.38rem 0.6rem;
  font-size: 0.8rem;
}

textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-std);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.btn {
  height: var(--control-height);
  padding: 0 0.95rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 30px;
  padding: 0 0.65rem;
  font-size: 0.74rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-std);
}

.btn-secondary:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange-dark);
}

.btn-ghost {
  height: 30px;
  padding: 0 0.6rem;
  font-size: 0.75rem;
  background: #ffffff;
  color: var(--text-secondary);
  border-color: var(--border-std);
}

.btn-ghost:hover {
  color: #ef4444;
  border-color: #fecaca;
}

.btn-danger {
  height: 30px;
  padding: 0 0.65rem;
  font-size: 0.74rem;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.action-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

/* ============================================================================
 * 5. KPI CARDS, PANELS & TABLES
 * ============================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  min-width: 0;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-std);
  border-top: 3px solid var(--brand-orange);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.tab-panel {
  display: none;
  min-width: 0;
  max-width: 100%;
}

.tab-panel.active {
  display: block;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.25rem;
  min-width: 0;
}

.card {
  background: #ffffff;
  border: 1px solid var(--border-std);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  max-width: 100%;
}

.card.editing-highlight {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

.mt-md {
  margin-top: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-std);
  flex-wrap: wrap;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-orange {
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  border: 1px solid var(--brand-orange-border);
}

.badge-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-std);
}

.badge-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Status Lists */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border-std);
  font-size: 0.82rem;
  font-weight: 500;
  flex-wrap: wrap;
}

.status-row-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

/* Tables */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.81rem;
}

.data-table th,
.data-table td {
  padding: 0.68rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-std);
  vertical-align: middle;
}

.data-table th {
  background: var(--brand-orange-soft);
  color: var(--brand-orange-deep);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background-color: #fffaf5;
}

.code-box {
  background: #0f172a;
  color: #f8fafc;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  max-height: 290px;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.hex-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-deep);
  border: 1px solid var(--brand-orange-border);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.73rem;
  font-weight: 600;
  max-width: 220px;
  word-break: break-all;
}

/* Toast Notifications */
.toast-stack {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
}

.toast-item {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--brand-orange-border);
  border-left: 4px solid var(--brand-orange);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.95rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 380px;
  font-weight: 500;
}

/* ============================================================================
 * 6. RESPONSIVE BREAKPOINTS (TABLET & HANDPHONE / MOBILE)
 * ============================================================================ */
@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .filter-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(272px, 84vw);
    height: 100dvh;
    z-index: 200;
    transform: translateX(-105%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .btn-close-drawer {
    display: inline-flex;
  }

  .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .top-navbar {
    padding: 0.65rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .navbar-left {
    width: 100%;
  }

  .navbar-right {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
  }

  .vendor-filter-box {
    grid-column: 1 / -1;
    width: 100%;
  }

  .vendor-filter-box select {
    width: 100%;
    min-width: 0;
  }

  .navbar-actions-group {
    justify-content: flex-start;
  }

  .user-profile-chip {
    justify-self: end;
  }

  .content-area {
    padding: 0.85rem;
  }

  .card {
    padding: 0.95rem;
  }

  .form-grid,
  .filter-toolbar,
  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-btn-row {
    width: 100%;
  }

  .form-btn-row .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .hide-on-mobile {
    display: none;
  }

  .login-card {
    padding: 1.25rem;
  }

  .demo-pills {
    grid-template-columns: 1fr;
  }

  .navbar-right {
    grid-template-columns: 1fr;
  }

  .navbar-actions-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .user-profile-chip {
    width: 100%;
    justify-content: space-between;
  }

  .template-actions {
    width: 100%;
  }

  .template-actions .btn {
    flex: 1 1 auto;
  }

  .toast-stack {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
