/* ==============================================================================
   NSM - ERP SYSTEM - Executive BioTime & POS Enterprise Styling
   PT. Amanda Teknologi Nusantara (NUSAMANDA)
   Theme: Signature Ocean Blue (#2563EB) & Anti-Slop High-Contrast Design
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand Primary: Signature Ocean Blue (POS Blue) */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-dark: #1E40AF;
  --primary-soft: #EFF6FF;
  --primary-border: #BFDBFE;
  --primary-text: #1E3A8A;
  --accent: #3B82F6;

  /* Neutrals & Canvas */
  --canvas: #F8FAFC;
  --surface: #FFFFFF;
  --surface-hover: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  /* Typography Colors */
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #64748B;
  --text-inverse: #FFFFFF;

  /* Semantic Feedback */
  --success: #059669;
  --success-soft: #ECFDF5;
  --success-border: #A7F3D0;
  --success-text: #065F46;

  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --warning-border: #FDE68A;
  --warning-text: #92400E;

  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --danger-border: #FECACA;
  --danger-text: #991B1B;

  --info: #0284C7;
  --info-soft: #F0F9FF;
  --info-border: #BAE6FD;
  --info-text: #075985;

  /* Layout Dimensions */
  --topbar-height: 60px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;

  /* Radius & Shadows (Strict Anti-Slop Hierarchy) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-modal: 0 20px 40px rgba(15, 23, 42, 0.18);

  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-brand: 'Plus Jakarta Sans', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --canvas: #0B0F17;
  --surface: #131B2A;
  --surface-hover: #1A2438;
  --border: #233048;
  --border-strong: #334466;

  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;

  --primary-soft: rgba(37, 99, 235, 0.16);
  --primary-border: rgba(37, 99, 235, 0.35);
  --primary-text: #93C5FD;

  --success-soft: rgba(5, 150, 105, 0.16);
  --success-border: rgba(5, 150, 105, 0.3);
  --success-text: #6EE7B7;

  --warning-soft: rgba(217, 119, 6, 0.16);
  --warning-border: rgba(217, 119, 6, 0.3);
  --warning-text: #FCD34D;

  --danger-soft: rgba(220, 38, 38, 0.16);
  --danger-border: rgba(220, 38, 38, 0.3);
  --danger-text: #FCA5A5;

  --info-soft: rgba(2, 132, 199, 0.16);
  --info-border: rgba(2, 132, 199, 0.3);
  --info-text: #7DD3FC;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Universal Vector Icon Sizing (Uci Anti-Slop Guard) */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  max-width: 100%;
}

/* App Structure */
#app {
  display: flex;
  min-height: 100vh;
}

/* Top Bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mac-traffic-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 4px;
}

.mac-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.mac-dot:hover {
  transform: scale(1.15);
}

.mac-dot.red { background: #FF5F56; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.mac-dot.yellow { background: #FFBD2E; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.mac-dot.green { background: #27C93F; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }

.sidebar-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

h1, h2, h3, h4, .brand-name, .btn, .sidebar-group-title, .user-text-name, .metric-value, .stat-value {
  font-family: var(--font-brand);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  display: block;
  height: 38px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.brand-badge:hover .brand-logo-img {
  transform: scale(1.04);
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.brand-tag {
  font-family: var(--font-brand);
  font-size: 9.5px;
  font-weight: 800;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 1.5px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-protocol-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
  animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.live-clock-wrapper {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-center-search {
  flex: 1;
  max-width: 440px;
  margin: 0 20px;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 36px;
  gap: 10px;
  transition: all 0.2s ease;
}

.search-input-box:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-input-box svg {
  color: var(--text-subtle);
  flex-shrink: 0;
}

.search-input-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  font-family: var(--font-sans);
  color: var(--text-main);
  width: 100%;
}

.search-kbd-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-icon-action-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-icon-action-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.notif-pulse-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: #EF4444;
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.user-selector-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 4px 14px 4px 6px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.user-selector-menu:hover {
  border-color: var(--primary-border);
  background: var(--surface);
}

.user-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.user-text-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-text-greeting {
  font-size: 12px;
  color: var(--text-muted);
}

.user-text-greeting strong {
  font-weight: 800;
  color: var(--text-main);
}

.user-text-name {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-main);
}

.user-text-role {
  font-size: 10px;
  color: var(--text-subtle);
}

/* Modern Finance Sidebar */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 0 10px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9.5px 14px;
  margin: 0;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: none;
  background: none;
  border-radius: 10px;
  width: 100%;
  text-align: left;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
  color: var(--text-subtle);
  transition: color 0.15s ease, transform 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.nav-item:hover svg {
  color: var(--primary);
  transform: translateX(1px);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}

.nav-item.active svg {
  color: var(--primary);
}

.nav-item.active .icon-home .home-roof {
  fill: currentColor;
}

.nav-item.active .icon-home .home-door {
  stroke: var(--surface);
  stroke-width: 2.5;
}

.sidebar-bottom-actions {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bottom-item {
  font-size: 12.5px;
  padding: 8px 12px;
}

.nav-item.active svg {
  color: var(--primary);
}



.nav-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.nav-badge.urgent {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-subtle);
}

.sidebar-footer-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: 500;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  flex: 1;
  padding: 24px 32px 64px;
  max-width: 1600px;
  min-height: calc(100vh - var(--topbar-height));
  transition: margin-left 0.2s ease;
}

/* Breadcrumb & Header Bar */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-group h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-group h1 svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
  color: var(--primary);
}

.page-title-group p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.page-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  font-family: inherit;
  text-decoration: none;
}

.btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.btn-sm svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-success:hover {
  background: #047857;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary-border);
}

.btn-outline-primary:hover {
  background: var(--primary-soft);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-outline-danger:hover {
  background: var(--danger-soft);
  color: #b91c1c;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Metric KPI Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  container-type: inline-size;
  container-name: kpiCard;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(14px, 4cqi, 18px) clamp(14px, 4.5cqi, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-label {
  font-size: clamp(11.5px, 3.5cqi, 13px);
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-icon-box {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.metric-icon-box svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.banner-icon-box svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.metric-icon-box.success {
  background: var(--success-soft);
  color: var(--success);
}

.metric-icon-box.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.metric-icon-box.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.metric-icon-box.info {
  background: var(--info-soft);
  color: var(--info);
}

.metric-value {
  font-size: clamp(20px, 8.5cqi, 32px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  line-height: 1.15;
  margin-bottom: 6px;
  word-break: normal;
  overflow-wrap: break-word;
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(11px, 3cqi, 12.5px);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.metric-trend-up {
  color: var(--success);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.metric-trend-down {
  color: var(--danger);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

/* Card Container */
.card {
  container-type: inline-size;
  container-name: erpCard;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title-group h3 {
  font-size: clamp(14px, 3.5cqi, 16px);
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-group h3 svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
  color: var(--primary);
  flex-shrink: 0;
}

.card-title-group p {
  font-size: clamp(11px, 2.6cqi, 12px);
  color: var(--text-subtle);
  margin-top: 2px;
}

.card-body {
  padding: 20px;
}

.card-body.no-padding {
  padding: 0;
}

/* Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

table.data-table th {
  background: var(--canvas);
  color: var(--text-subtle);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

table.data-table tr:hover td {
  background-color: var(--surface-hover);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-paid, .badge-online, .badge-completed, .badge-diterima, .badge-ditandatangani {
  background: var(--success-soft);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.badge-sent, .badge-dikirim, .badge-in_progress, .badge-diproses {
  background: var(--primary-soft);
  color: var(--primary-text);
  border: 1px solid var(--primary-border);
}

.badge-overdue, .badge-offline, .badge-urgent {
  background: var(--danger-soft);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.badge-draft, .badge-menunggu, .badge-backlog, .badge-low {
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-warning, .badge-in_review, .badge-medium, .badge-high {
  background: var(--warning-soft);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

/* Inflow / Outflow Pills */
.pill-inflow {
  background: var(--success-soft);
  color: var(--success);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.pill-outflow {
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

/* Task Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: start;
}

.kanban-column {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.kanban-column-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.kanban-cards-container {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.kanban-card {
  container-type: inline-size;
  container-name: kanbanCard;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: clamp(10px, 3.8cqi, 14px);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
  cursor: grab;
  min-width: 0;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
  transform: translateY(-2px);
}

.kanban-card-project {
  font-size: clamp(9px, 2.8cqi, 10px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.kanban-card-title {
  font-weight: 700;
  font-size: clamp(12px, 3.6cqi, 13px);
  color: var(--text-main);
  line-height: 1.35;
}

.kanban-card-desc {
  font-size: clamp(11px, 3.2cqi, 12px);
  color: var(--text-muted);
  line-height: 1.4;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
}

.kanban-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 600;
}

.kanban-card svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Modal Windows */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-dialog {
  transform: scale(1);
}

.modal-dialog.modal-lg {
  max-width: 900px;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  color: var(--primary);
  flex-shrink: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--canvas);
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Toast Notification */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 12px 18px;
  min-width: 300px;
  max-width: 420px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: toast-in 0.25s ease-out;
}

.toast svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  flex-shrink: 0;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Print Invoice Styling */
@media print {
  .topbar, .sidebar, .page-actions-group, .btn, #toast-container {
    display: none !important;
  }
  .main-wrapper {
    margin: 0 !important;
    padding: 0 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
    padding: 16px;
  }
  .kanban-board {
    grid-template-columns: 1fr;
  }
  .topbar-center {
    display: none;
  }
}

/* ==============================================================================
   Bagan Struktur Organisasi & Naungan Jabatan (Visual Canvas) - Equal Co-Owners
   ============================================================================== */
.org-canvas-viewport {
  position: relative;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--border-strong) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 32px 24px 44px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 480px;
}

.org-board-header {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-board-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-pill);
  font-family: var(--font-brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.org-board-subtitle {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.org-grid-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 24px;
  width: 100%;
  min-width: 900px;
  align-items: start;
}

.org-column,
.org-pillar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
}

.org-card {
  container-type: inline-size;
  container-name: orgCard;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(12px, 4cqi, 16px) clamp(14px, 4.5cqi, 18px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 100%;
}

.org-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
  border-color: var(--primary);
}

.org-card.owner-card {
  border: 1.5px solid var(--primary-border);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(37, 99, 235, 0.03) 100%);
}

.org-card.owner-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.16);
}

.org-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.org-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.org-card-info {
  overflow: hidden;
  flex: 1;
}

.org-card-name {
  font-weight: 800;
  font-size: clamp(12.5px, 4cqi, 14px);
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-card-user {
  font-size: clamp(10.5px, 3.2cqi, 11.5px);
  color: var(--primary);
  font-family: var(--font-brand);
  font-weight: 700;
}

.org-card-body {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.org-card-title {
  font-size: clamp(11.5px, 3.6cqi, 12.5px);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.org-card-div {
  font-size: clamp(10px, 3.2cqi, 11.5px);
  color: var(--text-muted);
}

.org-card-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  width: fit-content;
  margin-top: 4px;
}

.org-card-actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Vertical Straight Connector Line */
.org-stem,
.org-pillar-stem {
  width: 2px;
  height: 28px;
  background: var(--primary);
}

.org-subordinates-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.org-sub-stem {
  width: 2px;
  height: 20px;
  background: var(--primary);
}

.org-card.sub-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
}

.org-card.sub-card:hover {
  border-color: var(--primary);
}

.view-mode-toggle {
  display: flex;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.view-mode-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.view-mode-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ==============================================================================
   ULTRA-MODERN EXECUTIVE FINTECH DASHBOARD (Ref: Modern Clean Inspiring UI/UX)
   ============================================================================== */

.fin-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 40px;
}

/* ROW 1: Hero Grid */
.fin-hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  align-items: stretch;
}

/* Dark Executive Balance Card */
.fin-hero-dark-card {
  container-type: inline-size;
  container-name: heroCard;
  background: linear-gradient(135deg, #0B132B 0%, #111D4A 55%, #1A2744 100%);
  border-radius: 18px;
  padding: clamp(16px, 3.8cqi, 24px) clamp(16px, 4.2cqi, 28px);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(11, 19, 43, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 204px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.fin-hero-dark-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.fin-hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.fin-hero-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-hero-label {
  font-size: clamp(12px, 2.8cqi, 15px);
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.02em;
}

.fin-eye-btn {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.fin-eye-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.fin-pill-badge.success {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
  font-size: clamp(11px, 2.4cqi, 13px);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.fin-hero-val-row {
  margin: clamp(10px, 2.5cqi, 16px) 0 clamp(12px, 3cqi, 20px);
  z-index: 2;
}

.fin-hero-val {
  font-family: var(--font-brand);
  font-size: clamp(26px, 6.2cqi, 48px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  line-height: 1.15;
  word-break: normal;
  overflow-wrap: break-word;
}

.fin-hero-sub {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(12px, 2.6cqi, 14.5px);
  flex-wrap: wrap;
}

.fin-hero-sub .trend-up {
  color: #34D399;
  font-weight: 700;
}

.fin-hero-sub .trend-amount {
  color: #94A3B8;
}

.fin-hero-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 2;
}

.fin-timeframe-pills {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}

.fin-time-pill {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: clamp(10px, 2.2cqi, 11px);
  font-weight: 700;
  padding: clamp(4px, 0.9cqi, 5px) clamp(8px, 2cqi, 12px);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fin-time-pill:hover {
  color: #FFFFFF;
}

.fin-time-pill.active {
  background: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.45);
}

.fin-hero-sparkline {
  width: 140px;
  height: 46px;
}
.fin-sparkline-svg {
  width: 100%;
  height: 100%;
}

/* Goal Progress Card */
.fin-goal-card {
  container-type: inline-size;
  container-name: goalCard;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.fin-goal-body {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3.5cqi, 20px);
  margin-top: 10px;
  flex: 1;
}

.fin-radial-box {
  position: relative;
  width: clamp(84px, 20cqi, 108px);
  height: clamp(84px, 20cqi, 108px);
  flex-shrink: 0;
}

.fin-radial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.fin-radial-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 9;
}

.fin-radial-progress {
  fill: none;
  stroke: #6366F1;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fin-radial-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fin-radial-percent {
  font-family: var(--font-brand);
  font-size: clamp(18px, 6.2cqi, 24px);
  font-weight: 800;
  color: var(--text-main);
}

.fin-goal-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fin-goal-subtitle {
  font-size: clamp(13.5px, 3.8cqi, 16px);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.fin-goal-numbers {
  font-size: clamp(16.5px, 5.5cqi, 24px);
  color: var(--primary);
  font-family: var(--font-brand);
  line-height: 1.25;
}

.fin-goal-target-max {
  font-size: clamp(12.5px, 3.4cqi, 15px);
  color: var(--text-subtle);
  font-weight: 500;
}

.fin-goal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(11px, 2.8cqi, 13px);
  color: var(--text-muted);
  margin-top: 4px;
  flex-wrap: wrap;
}

.fin-goal-status .status-dot {
  width: 6px;
  height: 6px;
  background: #10B981;
  border-radius: 50%;
}

/* General Fin Card */
.fin-card {
  container-type: inline-size;
  container-name: finCard;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: clamp(14px, 3.5cqi, 20px) clamp(14px, 4cqi, 22px);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.fin-card:hover {
  box-shadow: 0 8px 26px -4px rgba(0, 0, 0, 0.06);
}

.fin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.fin-card-title {
  font-size: clamp(13px, 3.4cqi, 14.5px);
  font-weight: 800;
  font-family: var(--font-brand);
  color: var(--text-main);
}

.fin-card-link {
  font-size: clamp(11px, 2.6cqi, 12px);
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}
.fin-card-link:hover {
  text-decoration: underline;
}

/* ROW 2: 4 Metrics Strip */
.fin-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.fin-metric-card {
  container-type: inline-size;
  container-name: metricCard;
  padding: clamp(14px, 4.5cqi, 20px) clamp(14px, 5cqi, 22px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  min-height: 126px;
  justify-content: space-between;
}

.fin-metric-top {
  display: flex;
  align-items: center;
  gap: clamp(8px, 3cqi, 12px);
}

.fin-metric-icon-wrap {
  width: clamp(34px, 11cqi, 40px);
  height: clamp(34px, 11cqi, 40px);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fin-metric-icon-wrap.violet { background: #EEF2FF; color: #4F46E5; }
.fin-metric-icon-wrap.cyan { background: #E0F2FE; color: #0284C7; }
.fin-metric-icon-wrap.purple { background: #F3E8FF; color: #9333EA; }
.fin-metric-icon-wrap.emerald { background: #ECFDF5; color: #059669; }

[data-theme="dark"] .fin-metric-icon-wrap.violet { background: rgba(99, 102, 241, 0.18); color: #818CF8; }
[data-theme="dark"] .fin-metric-icon-wrap.cyan { background: rgba(6, 182, 212, 0.18); color: #38BDF8; }
[data-theme="dark"] .fin-metric-icon-wrap.purple { background: rgba(168, 85, 247, 0.18); color: #C084FC; }
[data-theme="dark"] .fin-metric-icon-wrap.emerald { background: rgba(16, 185, 129, 0.18); color: #34D399; }

.fin-metric-label {
  font-size: clamp(11.5px, 4.2cqi, 14px);
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-metric-val {
  font-family: var(--font-brand);
  font-size: clamp(18px, 9cqi, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-top: clamp(4px, 1.5cqi, 8px);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-metric-trend {
  font-size: clamp(11px, 3.8cqi, 13px);
  font-weight: 700;
  white-space: nowrap;
  margin-top: 2px;
}

.fin-metric-trend.up {
  color: #047857;
}
.fin-metric-trend.down {
  color: #DC2626;
}

/* ROW 3: Charts Grid */
.fin-charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}

.fin-chart-header-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.fin-chart-total {
  font-family: var(--font-brand);
  font-size: clamp(18px, 5.2cqi, 26px);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.fin-chart-pct {
  font-size: clamp(12px, 3.2cqi, 14.5px);
  font-weight: 700;
  color: #047857;
  white-space: nowrap;
}

.fin-dropdown-btn {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.fin-dropdown-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.fin-chart-viewport {
  width: 100%;
  height: 220px;
  margin-top: 10px;
}

.fin-perf-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fin-grid-line {
  stroke: var(--border);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.fin-axis-label {
  font-size: 10px;
  font-family: var(--font-sans);
  fill: var(--text-subtle);
}

.fin-month-labels text {
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--text-subtle);
  font-family: var(--font-sans);
}

/* Donut Chart Styling */
.fin-alloc-body {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4cqi, 28px);
  margin-top: 14px;
}

.fin-donut-box {
  position: relative;
  width: clamp(130px, 28cqi, 155px);
  height: clamp(130px, 28cqi, 155px);
  flex-shrink: 0;
}

.fin-donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.fin-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.fin-donut-val {
  font-family: var(--font-brand);
  font-size: clamp(12px, 3.4cqi, 14.5px);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.fin-donut-sub {
  font-size: clamp(8.5px, 2.2cqi, 10px);
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.fin-alloc-legend {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.8cqi, 10px);
  flex: 1;
  min-width: 0;
}

.fin-legend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: clamp(11.5px, 3cqi, 13px);
}

.fin-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.fin-legend-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fin-legend-name {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: clamp(160px, 42cqi, 280px);
  font-size: clamp(11.5px, 3cqi, 13px);
}

.fin-legend-pct {
  font-weight: 700;
  color: var(--text-main);
  font-size: clamp(11.5px, 3cqi, 13.5px);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ROW 4: 3 Operational Detail Widgets */
.fin-tri-widgets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.fin-table-header-mini {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  font-size: clamp(9.5px, 2.6cqi, 11px);
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.fin-watchlist-list,
.fin-tx-list,
.fin-insights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fin-watchlist-item {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.fin-watchlist-item:last-child {
  border-bottom: none;
}

.fin-watch-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.fin-watch-sym-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--canvas);
  border: 1px solid var(--border);
  font-size: 9.5px;
  font-weight: 800;
  font-family: var(--font-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  flex-shrink: 0;
}

.fin-watch-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fin-watch-sym {
  font-size: clamp(11px, 2.8cqi, 12px);
  font-weight: 800;
  color: var(--text-main);
}

.fin-watch-name {
  font-size: clamp(9px, 2.4cqi, 10px);
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-watch-price {
  font-size: clamp(10.5px, 2.8cqi, 12px);
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.fin-watch-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.fin-watch-badge {
  font-size: clamp(9px, 2.2cqi, 10px);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.fin-watch-badge.up {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.fin-watch-badge.down {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
}

/* Recent Transactions */
.fin-tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.fin-tx-item:last-child {
  border-bottom: none;
}

.fin-tx-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fin-tx-icon.in {
  background: #ECFDF5;
  color: #047857;
}
.fin-tx-icon.out {
  background: #FEF2F2;
  color: #DC2626;
  transform: rotate(90deg);
}

[data-theme="dark"] .fin-tx-icon.in { background: rgba(16, 185, 129, 0.15); color: #34D399; }
[data-theme="dark"] .fin-tx-icon.out { background: rgba(239, 68, 68, 0.15); color: #F87171; }

.fin-tx-info {
  flex: 1;
  overflow: hidden;
}

.fin-tx-title {
  font-size: clamp(11.5px, 3cqi, 12.5px);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-tx-sub {
  font-size: clamp(9.5px, 2.5cqi, 10.5px);
  color: var(--text-subtle);
  white-space: nowrap;
}

.fin-tx-amount {
  font-family: var(--font-brand);
  font-size: clamp(11.5px, 3cqi, 13px);
  font-weight: 800;
  white-space: nowrap;
}
.fin-tx-amount.plus {
  color: #047857;
}
.fin-tx-amount.minus {
  color: #0F172A;
}
[data-theme="dark"] .fin-tx-amount.minus {
  color: #F1F5F9;
}

/* Market Insights */
.fin-insight-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.fin-insight-item:last-child {
  border-bottom: none;
}

.fin-insight-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fin-insight-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fin-insight-title {
  font-size: clamp(11px, 2.8cqi, 12px);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.fin-insight-snippet {
  font-size: clamp(10px, 2.5cqi, 11px);
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fin-insight-time {
  font-size: clamp(9px, 2.2cqi, 10px);
  color: var(--text-subtle);
  margin-top: 2px;
}

/* ========================================================================== */
/* RESPONSIVE CARD CONTAINER QUERIES & BREAKPOINTS (Uci Responsive Engine)    */
/* ========================================================================== */

@container metricCard (max-width: 220px) {
  .fin-metric-card {
    padding: 12px 14px;
    gap: 4px;
  }
  .fin-metric-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
  .fin-metric-icon-wrap svg {
    width: 15px;
    height: 15px;
  }
}

@container metricCard (max-width: 175px) {
  .fin-metric-card {
    padding: 10px 10px;
    gap: 3px;
  }
  .fin-metric-val {
    font-size: 13.5px;
  }
  .fin-metric-label {
    font-size: 10px;
  }
  .fin-metric-trend {
    font-size: 9.5px;
  }
}

@container heroCard (max-width: 480px) {
  .fin-hero-dark-card {
    padding: 16px;
    min-height: auto;
  }
  .fin-hero-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .fin-hero-sparkline {
    width: 100%;
    height: 36px;
  }
  .fin-timeframe-pills {
    width: 100%;
    justify-content: space-between;
  }
  .fin-time-pill {
    flex: 1;
    text-align: center;
    padding: 5px 2px;
  }
}

@container goalCard (max-width: 330px) {
  .fin-goal-body {
    gap: 12px;
  }
  .fin-radial-box {
    width: 76px;
    height: 76px;
  }
}

@container goalCard (max-width: 260px) {
  .fin-goal-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@container finCard (max-width: 340px) {
  .fin-alloc-body {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .fin-legend-name {
    max-width: 140px;
  }
  .fin-donut-box {
    width: 120px;
    height: 120px;
  }
}

@container erpCard (max-width: 480px) {
  .card-header {
    padding: 12px 14px;
  }
  .card-body {
    padding: 14px;
  }
}

/* ========================================================================== */
/* RESPONSIVE VIEWPORT BREAKPOINTS                                            */
/* ========================================================================== */

@media (max-width: 1280px) {
  .fin-metrics-strip {
    gap: 14px;
  }
}

@media (max-width: 1140px) {
  .fin-hero-grid {
    grid-template-columns: 1fr;
  }
  .fin-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .fin-charts-grid {
    grid-template-columns: 1fr;
  }
  .fin-tri-widgets-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .fin-metrics-strip {
    grid-template-columns: 1fr;
  }
  .topbar-center-search {
    display: none;
  }
  .fin-hero-val-row {
    margin: 10px 0 14px;
  }
}

/* ========================================================================== */
/* LOGIN SCREEN & AUTHENTICATION PORTAL                                       */
/* ========================================================================== */

.login-screen-wrapper {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.login-backdrop-glow {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 350px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.16) 0%, rgba(37, 99, 235, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-card-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 38px 34px;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.login-brand-header {
  text-align: center;
  margin-bottom: 26px;
}

.login-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-logo-img {
  height: 48px;
  object-fit: contain;
}

.login-title {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 12.5px;
  color: var(--text-subtle);
  line-height: 1.4;
}

.login-alert-box {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 18px;
  line-height: 1.35;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-pwd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.login-pwd-hint {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  color: var(--text-subtle);
  pointer-events: none;
}

.login-input {
  padding-left: 42px !important;
  padding-right: 44px !important;
  height: 46px;
  font-size: 13.5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--canvas);
  transition: all 0.2s ease;
}

.login-input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pwd-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.pwd-toggle-btn:hover {
  color: var(--text-main);
}

.login-submit-btn {
  width: 100%;
  height: 46px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.login-submit-btn:active {
  transform: scale(0.99);
}

.login-quick-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.login-quick-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.login-quick-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.login-quick-pill {
  background: var(--canvas);
  border: 1px solid var(--border);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-quick-pill:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.login-quick-pill.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.login-footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 20px;
}

/* ========================================================================== */
/* SETTINGS & PROFILE VIEW STYLING                                            */
/* ========================================================================== */

.settings-hero-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--canvas) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  flex-wrap: wrap;
  gap: 16px;
}

.settings-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.settings-avatar-circle {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #FFFFFF;
  font-family: var(--font-brand);
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.settings-hero-name {
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.settings-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.settings-badge-role {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.settings-user-tag {
  font-size: 12px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.settings-status-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
}

.settings-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.settings-div-tag {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.settings-job-tag {
  font-size: 12px;
  color: var(--text-subtle);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}

.settings-card {
  padding: 0;
  overflow: hidden;
}

.settings-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.notice-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-text {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.45;
}

.notice-text code {
  background: rgba(37, 99, 235, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-control {
  padding-right: 42px;
}

.password-input-wrap .pwd-toggle-btn {
  right: 10px;
}

.input-with-badge {
  position: relative;
  display: flex;
  align-items: center;
}

.field-fixed-badge {
  position: absolute;
  right: 12px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-subtle);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.settings-action-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .settings-hero-right {
    align-items: flex-start;
  }
}
