/* 
 * Kalamedia Agency Financial & Project Management System
 * Design System: Professional SaaS Dashboard (Shopeers / Linear / Stripe style)
 * Primary Accent: #2563EB, Canvas: #F8F9FA, Sidebar: #F8F9FB, Border: #EAECEF
 * Typography: Inter (wght 400, 500, 600, 700)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-main: var(--font-sans);
  
  /* Canvas & Surfaces (SaaS Minimal) */
  --bg-main: #F8F9FA;
  --bg-sidebar: #F8F9FB;
  --bg-topbar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #F9FAFB;
  --bg-table-header: #FFFFFF;
  --bg-pill-active: #2563EB;
  
  /* Borders (#EAECEF & #F3F4F6) */
  --border-color: #EAECEF;
  --border-input: #E5E7EB;
  --border-focus: #2563EB;
  --border-light: #F3F4F6;
  
  /* Typography (Inter High Contrast) */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --text-tertiary: #D1D5DB;
  --text-white: #FFFFFF;
  
  /* Primary Action Button (#2563EB) */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-active: #1E40AF;
  --primary-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --primary-tint: #EFF6FF;
  
  /* Secondary Accent */
  --secondary: #4F46E5;
  --secondary-tint: #EEF2FF;
  --gradient-accent: linear-gradient(135deg, #5D76F5 0%, #8932E0 100%);
  --gradient-bar: linear-gradient(90deg, #5D76F5 0%, #8932E0 100%);
  
  /* Status Accents (Bankio Soft Pills) */
  --success: #10B981;
  --success-bg: #ECFDF5;
  --success-text: #059669;
  --success-border: #A7F3D0;
  
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --warning-text: #B45309;
  --warning-border: #FDE68A;
  
  --danger: #EF4444;
  --danger-bg: #FFF1F2;
  --danger-text: #E11D48;
  --danger-border: #FFE4E6;
  
  --info: #5D76F5;
  --info-bg: rgba(93, 118, 245, 0.10);
  --info-text: #4A63E2;
  --info-border: rgba(93, 118, 245, 0.25);
  
  /* Border Radius (Bankio Soft Rounded) */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-card: 22px;
  --radius-modal: 24px;
  --radius-full: 9999px;
  
  /* Subtle Delicate Shadows */
  --shadow-xs: 0 1px 2px rgba(18, 24, 48, 0.03);
  --shadow-sm: 0 2px 6px -1px rgba(18, 24, 48, 0.04);
  --shadow-card: 0 10px 30px -10px rgba(18, 24, 48, 0.05), 0 2px 6px -1px rgba(18, 24, 48, 0.02);
  --shadow-lg: 0 16px 32px -8px rgba(18, 24, 48, 0.08);
  --shadow-modal: 0 20px 40px -10px rgba(18, 24, 48, 0.12);
  
  /* GPU-Accelerated 60FPS Animation Easing & Timing */
  --ease-out-natural: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-tactile: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-base: 200ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-smooth: 260ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, opacity 200ms ease;
}

/* Native View Transitions (Zero-Flicker Multi-Page Transitions) */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 160ms cubic-bezier(0.22, 1, 0.36, 1) both kalaPageExit;
}

::view-transition-new(root) {
  animation: 260ms cubic-bezier(0.22, 1, 0.36, 1) both kalaPageEnter;
}

/* Page & Component 60FPS Micro-Animations */
@keyframes kalaPageEnter {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes kalaPageExit {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, -6px, 0) scale(0.995);
  }
}

@keyframes kalaCardEnter {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

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

html, body, *, *::before, *::after, button, input, select, textarea, table, th, td, .fc {
  font-family: var(--font-sans) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans) !important;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   STANDARDIZED TYPOGRAPHY SYSTEM (INTER SAAS / LINEAR STYLE)
   ========================================================================== */
h1, .h1, .page-title {
  font-size: 18px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.02em !important;
  color: #111827 !important;
}

h2, .h2, h3, .h3, .panel-title, .card-title, .modal-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.015em !important;
  color: #111827 !important;
}

h4, .h4 {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: #111827 !important;
}

h5, .h5 {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: #111827 !important;
}

p, .panel-subtitle, .card-desc {
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #6B7280;
}

small, .text-muted {
  font-size: 12px;
  line-height: 1.4;
  color: #9CA3AF;
}

.text-secondary {
  color: #6B7280 !important;
}

/* Forms & Interactive Typography */
label, .form-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #344054 !important;
  line-height: 1.3 !important;
  margin-bottom: 6px !important;
  display: block;
}

input, select, textarea, .form-control, .form-select {
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  color: #101828 !important;
}

button, .btn {
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: -0.1px !important;
}

/* Tables Typography */
table {
  font-size: 13px;
}

table th, .table th {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  color: #949AB1 !important;
}

table td, .table td {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #101828 !important;
  line-height: 1.45 !important;
}

/* KPI Numbers & Section Titles (Proportional Bankio Metric Sizing) */
.kpi-value, .stat-value, .bento-metric-value {
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.3px !important;
  color: #101828 !important;
}

.metric-value {
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.3px !important;
  color: #101828 !important;
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 5px !important;
}

.metric-num, .kpi-num, .stat-num {
  font-size: 24px !important;
  font-weight: 800 !important;
  color: #101828 !important;
  line-height: 1.15 !important;
}

.metric-unit, .stat-unit, .kpi-unit {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #6E7485 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.kpi-title, .stat-label, .metric-label, .bento-metric-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: #949AB1 !important;
}

/* Badges & Tags */
.badge, .role-badge, .status-pill, .badge-pill {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  line-height: 1.2 !important;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Mobile Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16, 24, 40, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 240ms ease;
  will-change: opacity;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  color: #344054;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: #F9FAFB;
  color: #101828;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #667085;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.sidebar-close-btn:hover {
  color: #101828;
}

/* ==========================================================================
   1. UNIVERSAL SIDEBAR COMPONENT
   ========================================================================== */
.sidebar {
  width: 250px;
  background: #F8F9FB;
  border-right: 1px solid #EAECEF;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #EAECEF;
  flex-shrink: 0;
  background: #F8F9FB;
}

.sidebar-close-btn {
  display: none;
}

.sidebar-brand-img {
  height: 26px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  display: block;
}

.role-badge-sidebar {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 6px;
  background: #EFF6FF;
  color: #2563EB;
  white-space: nowrap;
  border: 1px solid #DBEAFE;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #FFFFFF;
  flex-shrink: 0;
}

.brand-info h2 {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #111827;
  line-height: 1.2;
}

.brand-info span {
  font-size: 10px;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.sidebar-nav {
  padding: 8px 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #E5E7EB transparent;
}

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

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 999px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9CA3AF;
  letter-spacing: 0.04em;
  padding: 0 10px;
  margin: 12px 0 4px;
  line-height: 1.2;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  min-height: 34px;
  transition: all 150ms ease;
  position: relative;
  box-sizing: border-box;
}

.nav-link svg {
  display: inline-block !important;
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  flex-shrink: 0;
  stroke: #6B7280;
  fill: none;
  transition: stroke 150ms ease;
}

.nav-link:hover:not(.active) {
  color: #111827;
  background: #F3F4F6;
}

.nav-link:hover:not(.active) svg {
  stroke: #111827;
}

.nav-link:active {
  transform: scale(0.99);
}

.nav-link.active {
  color: #2563EB !important;
  background: #EFF6FF !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  border-left: 3px solid #2563EB !important;
  padding-left: 9px !important;
}

.nav-link.active svg {
  stroke: #2563EB !important;
}

/* Dedicated Logout Nav Link */
.nav-link.nav-link-logout {
  color: #E11D48 !important;
  font-weight: 600;
  margin-top: 1px;
}

.nav-link.nav-link-logout svg {
  stroke: #E11D48 !important;
}

.nav-link.nav-link-logout:hover {
  color: #BE123C !important;
  background: rgba(225, 29, 72, 0.08) !important;
  transform: translate3d(3px, 0, 0);
}

.nav-link.nav-link-logout:hover svg {
  stroke: #BE123C !important;
  transform: scale(1.05);
}

.nav-link.nav-link-logout:active {
  transform: scale(0.98);
  background: rgba(225, 29, 72, 0.14) !important;
}

/* Sidebar User Footer (Refined Bankio Minimal Profile Card) */
.sidebar-user {
  flex-shrink: 0;
  margin-top: auto;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border-color);
  background: #FFFFFF;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  background: #F8F9FD;
  border: 1px solid #ECEEF5;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.user-profile:hover {
  background: #F1F3FB;
  border-color: #E2E5F0;
  box-shadow: 0 2px 6px rgba(18, 24, 48, 0.04);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5D76F5 0%, #8932E0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11.5px;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(93, 118, 245, 0.22);
  position: relative;
}

.avatar::after {
  content: '';
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #FFFFFF;
}

.user-details {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-details h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #101828;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  letter-spacing: -0.2px;
  margin: 0;
}

.user-details .role-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  background: rgba(93, 118, 245, 0.10);
  color: #5D76F5;
  border: 1px solid rgba(93, 118, 245, 0.2);
  line-height: 1.2;
}

/* ==========================================================================
   2. UNIVERSAL TOPBAR / HEADER COMPONENT
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-topbar);
  position: sticky;
  top: 0;
  z-index: 90;
}

.greeting-text {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.greeting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.greeting-heading {
  font-size: 15px;
  font-weight: 700;
  color: #101828;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.greeting-name {
  white-space: nowrap;
}

.greeting-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

/* Filter Group (Bankio Pill Segmented Control) */
.date-filter-group {
  display: inline-flex;
  background: #EEF0F6;
  border: 1px solid #ECEEF5;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.date-filter-group::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: transparent;
  border: none;
  color: #6E7485;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.filter-btn:hover {
  color: #000000;
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.filter-btn.active {
  background: #5D76F5 !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(93, 118, 245, 0.25) !important;
  border-radius: 999px !important;
  text-decoration: none !important;
}

/* Breadcrumbs & Active Page Indicator */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.breadcrumb-root {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-sep {
  color: var(--text-tertiary);
  font-size: 11px;
}

.breadcrumb-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(93, 118, 245, 0.10);
  color: #5D76F5;
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(93, 118, 245, 0.2);
}

/* Leaderboard Rank Badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease;
}
.rank-badge:hover {
  transform: scale(1.08);
}

.rank-badge-1 {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 1px solid #FCD34D;
  box-shadow: 0 2px 5px rgba(245, 158, 11, 0.2);
}

.rank-badge-2 {
  background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
  color: #334155;
  border: 1px solid #CBD5E1;
  box-shadow: 0 2px 4px rgba(100, 116, 139, 0.12);
}

.rank-badge-3 {
  background: linear-gradient(135deg, #FFEDD5 0%, #FED7AA 100%);
  color: #9A3412;
  border: 1px solid #FDBA74;
  box-shadow: 0 2px 4px rgba(234, 88, 12, 0.15);
}

.rank-badge-other {
  background: #F8FAFC;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

.clickable-client-link {
  color: #101828;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}
.clickable-client-link:hover {
  color: #2563EB;
}
.clickable-client-link .icon-open {
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateX(-2px);
}
.clickable-client-link:hover .icon-open {
  opacity: 1;
  transform: translateX(0);
}

.content-body {
  padding: 28px;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  animation: kalaPageEnter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

.content-body.kala-page-exit {
  animation: kalaPageExit 140ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
}

/* ==========================================================================
   3. BUTTONS (COMPACT SAAS / LINEAR STYLE)
   ========================================================================== */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
  box-sizing: border-box;
  will-change: transform;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
}

button:active,
.btn:active {
  transform: translateY(0);
}

/* Primary Action Button (SaaS Blue #2563EB) */
.btn-primary {
  background: #2563EB;
  color: #FFFFFF;
  border: 1px solid #2563EB;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.btn-primary:hover {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #FFFFFF;
}

.btn-primary:active {
  background: #1E40AF;
  border-color: #1E40AF;
}

/* Secondary Button (Minimalist Outlined) */
.btn-secondary {
  background: #FFFFFF;
  color: #374151;
  border: 1px solid #D1D5DB;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.btn-secondary:hover {
  background: #F9FAFB;
  color: #111827;
  border-color: #9CA3AF;
}

.btn-secondary:active {
  background: #F3F4F6;
}

/* Success Button */
.btn-success {
  background: #10B981;
  color: #FFFFFF;
  border: 1px solid #10B981;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.15);
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
}

/* Danger Button */
.btn-danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FEE2E2;
}

.btn-danger:hover {
  background: #FEE2E2;
  color: #B91C1C;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 6px;
}

/* ==========================================================================
   4. CARDS & KPI METRIC PANELS (BANKIO 22PX BENTO & STAGGERED ENTRANCE)
   ========================================================================== */
.kpi-grid,
.kala-grid-kpi,
.portal-stats-grid,
.alert-cards-grid,
.bento-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kala-grid-2col,
.kala-grid-2col-equal,
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.owner-dashboard-grid,
.kala-dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

.kala-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.owner-full-width-panel {
  grid-column: span 2;
  margin-top: 20px;
}

.form-row,
.kala-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.kpi-card,
.bento-metric-card,
.stat-card,
.portal-stat-card,
.kpi-tile {
  background: #FFFFFF !important;
  border: 1px solid #EAECEF !important;
  border-radius: 12px !important;
  padding: 16px 18px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 96px;
  box-sizing: border-box !important;
  will-change: transform;
}

.kpi-card:hover,
.bento-metric-card:hover,
.stat-card:hover,
.portal-stat-card:hover,
.kpi-tile:hover {
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06) !important;
  border-color: #D1D5DB !important;
  transform: translateY(-1px) !important;
}

/* Staggered entrance for KPI cards */
.kpi-grid > *:nth-child(1),
.bento-kpi-grid > *:nth-child(1),
.stat-cards-grid > *:nth-child(1),
.stats-grid > *:nth-child(1) {
  animation: kalaCardEnter 280ms cubic-bezier(0.22, 1, 0.36, 1) 0ms both;
  will-change: transform, opacity;
}
.kpi-grid > *:nth-child(2),
.bento-kpi-grid > *:nth-child(2),
.stat-cards-grid > *:nth-child(2),
.stats-grid > *:nth-child(2) {
  animation: kalaCardEnter 280ms cubic-bezier(0.22, 1, 0.36, 1) 35ms both;
  will-change: transform, opacity;
}
.kpi-grid > *:nth-child(3),
.bento-kpi-grid > *:nth-child(3),
.stat-cards-grid > *:nth-child(3),
.stats-grid > *:nth-child(3) {
  animation: kalaCardEnter 280ms cubic-bezier(0.22, 1, 0.36, 1) 70ms both;
  will-change: transform, opacity;
}
.kpi-grid > *:nth-child(4),
.bento-kpi-grid > *:nth-child(4),
.stat-cards-grid > *:nth-child(4),
.stats-grid > *:nth-child(4) {
  animation: kalaCardEnter 280ms cubic-bezier(0.22, 1, 0.36, 1) 105ms both;
  will-change: transform, opacity;
}
.kpi-grid > *:nth-child(n+5),
.bento-kpi-grid > *:nth-child(n+5) {
  animation: kalaCardEnter 280ms cubic-bezier(0.22, 1, 0.36, 1) 140ms both;
  will-change: transform, opacity;
}

.kpi-header,
.metric-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
}

.kpi-title,
.metric-label,
.bento-metric-label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #4B5563 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  margin: 0 !important;
}

.kpi-icon,
.metric-icon {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  color: #2563EB !important;
  flex-shrink: 0 !important;
}

.kpi-icon svg,
.metric-icon svg {
  width: 16px !important;
  height: 16px !important;
  stroke: #2563EB !important;
  stroke-width: 1.75 !important;
}

.kpi-value,
.metric-value,
.bento-metric-value,
.metric-num {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.2 !important;
  margin: 0 0 4px 0 !important;
  font-feature-settings: 'tnum' 1 !important;
  font-variant-numeric: tabular-nums !important;
}

.kpi-meta,
.metric-subtitle,
.metric-desc {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #9CA3AF !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

.metric-unit {
  display: none !important;
}

.badge-margin {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
}

.badge-margin.good { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.badge-margin.warning { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.badge-margin.bad { background: #FEF2F2; color: #DC2626; border: 1px solid #FEE2E2; }

/* Quick Action Grid */
.quick-actions-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.quick-action-card {
  background: #FFFFFF;
  border: 1px solid #EAECEF;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.quick-action-card:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
  transform: translateY(-1px);
}

.action-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #EFF6FF;
  color: #2563EB;
}

.action-icon svg {
  width: 18px;
  height: 18px;
  stroke: #2563EB;
  stroke-width: 1.75;
}

.action-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.action-desc {
  font-size: 11.5px;
  color: #6B7280;
}

/* Alert Summary Cards (A/R, A/P, Missing Receipts) */
.alert-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.alert-card {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #EAECEF;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.alert-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
  transform: translateY(-1px);
}

.alert-card.warning-border { border-left: 3px solid var(--warning); }
.alert-card.danger-border { border-left: 3px solid var(--danger); }
.alert-card.info-border { border-left: 3px solid var(--primary); }

.alert-card-info h5 {
  font-size: 12px;
  color: #6B7280;
  font-weight: 500;
}

.alert-card-info .count {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-top: 2px;
  letter-spacing: -0.02em;
}

.alert-card-info .subtext {
  font-size: 11.5px;
  color: #9CA3AF;
}

/* ==========================================================================
   5. PANELS & TABLES (SAAS MINIMAL / LINEAR STYLE)
   ========================================================================== */
.glass-panel,
.bento-table-card {
  background: #FFFFFF !important;
  border: 1px solid #EAECEF !important;
  border-radius: 12px !important;
  padding: 20px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
}

.panel-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 16px !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
}

.panel-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  letter-spacing: -0.015em !important;
}

.panel-title svg {
  color: #2563EB !important;
}

/* Clean Segmented Control Bar 1 Baris ala SaaS */
.segmented-control,
.client-filter-pill-bar,
.bento-tabs-group,
.date-filter-group,
.workspace-tabs-bar,
.task-services-track {
  background: #F3F4F6 !important;
  padding: 3px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
  border: none !important;
  box-sizing: border-box !important;
}

.segmented-control::-webkit-scrollbar,
.client-filter-pill-bar::-webkit-scrollbar,
.bento-tabs-group::-webkit-scrollbar,
.date-filter-group::-webkit-scrollbar,
.workspace-tabs-bar::-webkit-scrollbar,
.task-services-track::-webkit-scrollbar {
  display: none !important;
}

.segmented-control-item,
.client-filter-pill,
.bento-tab-btn,
.workspace-tab-btn,
.task-service-pill,
.tab-btn,
.filter-btn {
  background: transparent !important;
  border: none !important;
  color: #6B7280 !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
  outline: none !important;
}

.segmented-control-item:hover:not(.active),
.client-filter-pill:hover:not(.active),
.bento-tab-btn:hover:not(.active),
.workspace-tab-btn:hover:not(.active),
.task-service-pill:hover:not(.active),
.tab-btn:hover:not(.active),
.filter-btn:hover:not(.active) {
  color: #111827 !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

.segmented-control-item.active,
.client-filter-pill.active,
.bento-tab-btn.active,
.workspace-tab-btn.active,
.task-service-pill.active,
.tab-btn.active,
.filter-btn.active {
  background: #FFFFFF !important;
  border: none !important;
  color: #111827 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08) !important;
  text-decoration: none !important;
}

/* Table Responsive & Custom Thin Scrollbar (4px, No Thick Grey Bar!) */
.table-responsive,
.kala-table-scroll {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border: 1px solid #EAECEF !important;
  border-radius: 8px !important;
  background: #FFFFFF !important;
  scrollbar-width: thin !important;
  scrollbar-color: #E5E7EB transparent !important;
}

.kala-table-scroll::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
  height: 4px !important;
  width: 4px !important;
}

.kala-table-scroll::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
  background: transparent !important;
}

.kala-table-scroll::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: #E5E7EB !important;
  border-radius: 999px !important;
}

.table-custom,
.untitled-table {
  width: 100% !important;
  border-collapse: collapse !important;
  text-align: left !important;
}

.table-custom th,
.untitled-table th {
  padding: 10px 14px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #9CA3AF !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  background: #FFFFFF !important;
  border-bottom: 1px solid #F3F4F6 !important;
  white-space: nowrap !important;
}

.table-custom td,
.untitled-table td {
  padding: 12px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #374151 !important;
  border-bottom: 1px solid #F3F4F6 !important;
  vertical-align: middle !important;
}

.table-custom tr:hover td,
.untitled-table tr:hover td {
  background: #F9FAFB !important;
}

/* Borderless Soft Badges for Services & SDM */
.service-tag,
.spec-tag {
  background: #EFF6FF !important;
  color: #2563EB !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1.2 !important;
}
.service-tag-sosmed, .spec-tag-sosmed { background: #EFF6FF !important; color: #2563EB !important; border: none !important; }
.service-tag-desain, .spec-tag-desain { background: #FDF2FA !important; color: #C11574 !important; border: none !important; }
.service-tag-web, .spec-tag-web { background: #F4F3FF !important; color: #5925DC !important; border: none !important; }
.service-tag-ads, .spec-tag-ads { background: #ECFDF3 !important; color: #027A48 !important; border: none !important; }
.service-tag-default, .spec-tag-default { background: #F3F4F6 !important; color: #4B5563 !important; border: none !important; }

/* Card Toolbar SaaS Modern 1-Row Desktop / 2-Row Mobile */
.card-toolbar-saas {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.card-toolbar-header-row {
  flex: 1;
  min-width: 0;
}
.card-toolbar-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.desktop-only-btn {
  display: inline-flex !important;
}
.mobile-only-btn {
  display: none !important;
}

@media (max-width: 1024px) {
  .card-toolbar-saas {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }
  .card-toolbar-header-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .card-toolbar-filter-row {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
  }
  .card-toolbar-filter-row::-webkit-scrollbar {
    display: none !important;
  }
  .desktop-only-btn {
    display: none !important;
  }
  .mobile-only-btn {
    display: inline-flex !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
}

/* Page Header Bar (1-Row SaaS Header replacing verbose hero banners) */
.page-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-bar .page-title {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  letter-spacing: -0.02em !important;
  margin: 0 !important;
}
.page-header-bar p {
  font-size: 12.5px !important;
  color: #6B7280 !important;
  margin: 2px 0 0 !important;
}

/* Status Indicator Dots */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.dot-red {
  background-color: #EF4444;
}
.status-dot.dot-green {
  background-color: #10B981;
}
.status-dot.dot-amber {
  background-color: #F59E0B;
}
.status-dot.dot-blue {
  background-color: #2563EB;
}

/* Compact SaaS Button Enforcements */
.btn-compact,
.card-toolbar-saas .btn,
.panel-header .btn,
.page-header-bar .btn {
  height: 34px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  width: auto !important;
  flex-shrink: 0 !important;
}

/* Status Badges */
.badge-status,
.pill-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  text-transform: capitalize !important;
  border: none !important;
}

.badge-paid, .pill-paid {
  background: #ECFDF5 !important;
  color: #059669 !important;
}

.badge-draft, .pill-pending {
  background: #F3F4F6 !important;
  color: #4B5563 !important;
}

.badge-pending {
  background: #FFFBEB !important;
  color: #B45309 !important;
}

.badge-overdue {
  background: #FEF2F2 !important;
  color: #DC2626 !important;
}

.badge-type-in {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
}

.badge-type-out {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
}

/* ==========================================================================
   6. MODAL SYSTEM (BANKIO 60FPS SOFT SPRING POP & FADE OVERLAY)
   ========================================================================== */
.modal,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 48, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), visibility 180ms ease;
  will-change: opacity;
}

.modal.show,
.modal.active,
.modal-backdrop.show,
.modal-backdrop.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-dialog {
  background: #FFFFFF;
  border: 1px solid #ECEEF5;
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px -10px rgba(18, 24, 48, 0.12);
  color: #000000;
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.96);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.modal.show .modal-dialog,
.modal.active .modal-dialog,
.modal-backdrop.show .modal-dialog,
.modal-backdrop.active .modal-dialog {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

.modal-dialog.modal-lg {
  max-width: 840px;
}

/* Custom Destructive Confirmation Modal (Bankio Style) */
.modal-confirm-dialog {
  background: #FFFFFF;
  border: 1px solid #ECEEF5;
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  padding: 26px;
  box-shadow: 0 20px 40px -10px rgba(18, 24, 48, 0.12);
  color: #000000;
  text-align: left;
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.96);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.modal-backdrop.show .modal-confirm-dialog,
.modal-backdrop.active .modal-confirm-dialog {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

.confirm-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #FFF1F2;
  border: 1px solid #FFE4E6;
  color: #E11D48;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.confirm-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #000000;
  margin: 0 0 8px 0;
  letter-spacing: -0.2px;
}

.confirm-modal-desc {
  font-size: 14px;
  color: #6E7485;
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.confirm-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.btn-cancel-modal {
  background: #FFFFFF;
  border: 1px solid #ECEEF5;
  color: #6E7485;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cancel-modal:hover {
  background: #F8F9FC;
  color: #000000;
  border-color: #DDE1EE;
}

.btn-confirm-delete {
  background: #E11D48;
  border: 1px solid #E11D48;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-confirm-delete:hover {
  background: #BE123C;
  border-color: #BE123C;
}

/* ==========================================================================
   UNIFIED TABLE ACTION BUTTONS SYSTEM (BANKIO DESIGN)
   ========================================================================== */
.table-actions,
.action-btn-group,
.table-actions-cell {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  justify-content: flex-end !important;
  white-space: nowrap !important;
}

.table-custom th.th-actions,
.table-custom td.td-actions,
.untitled-table th.th-actions,
.untitled-table td.td-actions {
  text-align: right !important;
  white-space: nowrap !important;
  min-width: 170px;
}

.btn-action-view,
.btn-action-edit,
.btn-action-delete,
.btn-action-pay,
.btn-action-success,
.btn-action-outline,
.btn-delete-ghost {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 32px !important;
  width: auto !important;
  height: 32px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
  transition: all 160ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
  will-change: transform !important;
}

.btn-action-view,
.btn-action-outline {
  background: #FFFFFF !important;
  border: 1px solid #D0D5DD !important;
  color: #344054 !important;
}
.btn-action-view:hover,
.btn-action-outline:hover {
  background: #F8FAFC !important;
  border-color: #98A2B3 !important;
  color: #101828 !important;
  transform: translateY(-1px) !important;
}

.btn-action-edit {
  background: #EFF8FF !important;
  border: 1px solid #B2DDFF !important;
  color: #175CD3 !important;
}
.btn-action-edit:hover {
  background: #D1E9FF !important;
  border-color: #84CAFF !important;
  color: #155EEF !important;
  transform: translateY(-1px) !important;
}

.btn-action-delete,
.btn-delete-ghost {
  background: #FEF3F2 !important;
  border: 1px solid #FECDCA !important;
  color: #B42318 !important;
}
.btn-action-delete:hover,
.btn-delete-ghost:hover {
  background: #FEE4E2 !important;
  border-color: #FDA29B !important;
  color: #912018 !important;
  transform: translateY(-1px) !important;
}

.btn-action-pay {
  background: #5D76F5 !important;
  border: 1px solid #5D76F5 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
}
.btn-action-pay:hover {
  background: #4B63DE !important;
  border-color: #4B63DE !important;
  color: #FFFFFF !important;
  transform: translateY(-1px) !important;
}

.btn-action-success {
  background: #ECFDF3 !important;
  border: 1px solid #A6F4C5 !important;
  color: #027A48 !important;
  font-weight: 700 !important;
}
.btn-action-success:hover {
  background: #D1FADF !important;
  border-color: #6CE9A6 !important;
  color: #05603A !important;
  transform: translateY(-1px) !important;
}

.btn-delete-ghost svg,
.btn-action-delete svg {
  pointer-events: none;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 26px;
  border-bottom: 1px solid #ECEEF5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  border-radius: 24px 24px 0 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.2px;
}

.modal-close {
  background: #F8F9FC;
  border: 1px solid #ECEEF5;
  color: #6E7485;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  color: #000000;
  background: #EEF0F6;
}

.modal-body {
  padding: 26px;
  background: #FFFFFF;
}

.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid #ECEEF5;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #F8F9FC;
  border-radius: 0 0 24px 24px;
}

/* ==========================================================================
   7. FORM CONTROLS (BANKIO 14PX ROUNDED INPUTS)
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 6px;
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: #F8F9FC;
  border: 1px solid #ECEEF5;
  border-radius: 14px;
  color: #000000;
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: #5D76F5;
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(93, 118, 245, 0.15);
}

/* Rupiah Input Group */
.input-group-currency {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-group-currency .currency-addon {
  position: absolute;
  left: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #667085;
  pointer-events: none;
  user-select: none;
  z-index: 3;
}

.input-group-currency input.form-control,
.input-group-currency input.rupiah-input {
  padding-left: 40px !important;
  font-weight: 700;
  color: #101828;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

/* ==========================================================================
   8. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #101828;
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent-indigo);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  font-size: 13px;
  font-weight: 500;
  animation: slideInRight 0.25s ease-out;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   UNIVERSAL RESPONSIVE ARCHITECTURE
   Strict separation: Desktop (>1024px) vs Tablet (<=1024px) vs Mobile (<=768px)
   ========================================================================== */

/* Universal Horizontal Touch Swipe Scroll Wrapper */
.touch-swipe-x {
  width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  padding-bottom: 4px;
}

.touch-swipe-x::-webkit-scrollbar {
  height: 4px;
}

.touch-swipe-x::-webkit-scrollbar-thumb {
  background: #D0D5DD;
  border-radius: 4px;
}

.panel-title, .card-title, .kpi-title, .panel-header h3 {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

/* ==========================================================================
   1. TABLET SYSTEM (@media max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  /* Off-Canvas Slide-In Sidebar Drawer */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    transform: translate3d(-100%, 0, 0) !important;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
    display: flex !important;
  }

  .sidebar.open {
    transform: translate3d(0, 0, 0) !important;
  }

  .sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    background: #FFFFFF !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06) !important;
    cursor: pointer !important;
    color: #101828 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
  }

  .sidebar-close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    border: none !important;
    background: #F2F4F7 !important;
    color: #344054 !important;
    cursor: pointer !important;
    font-size: 22px !important;
    font-weight: 700 !important;
  }

  .sidebar-overlay {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(16, 24, 40, 0.5) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    z-index: 99998 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .sidebar-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* 2-Column KPI Cards on Tablet */
  .kpi-grid,
  .kala-grid-kpi,
  .portal-stats-grid,
  .alert-cards-grid,
  .bento-metrics-grid,
  .quick-actions-bar,
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  .owner-dashboard-grid,
  .kala-dashboard-bottom-grid,
  .settings-grid,
  .kala-grid-2col,
  .kala-grid-2col-equal {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .owner-full-width-panel {
    grid-column: span 1 !important;
  }
}

/* ==========================================================================
   2. SMARTPHONE SYSTEM (@media max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Anti-Overflow & Grid Safety */
  html, body, .app-container, .main-wrapper, .content-body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .main-wrapper {
    width: 100% !important;
    min-width: 0 !important;
  }

  .content-body {
    padding: 12px 14px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Mobile Topbar Navigation */
  .topbar {
    padding: 8px 14px !important;
    height: auto !important;
    min-height: 52px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--border-color) !important;
  }

  .greeting-text {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .greeting-info {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .topbar-breadcrumb {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
  }

  .greeting-heading {
    font-size: 14px !important;
    line-height: 1.25 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    gap: 4px !important;
    margin: 0 !important;
    font-weight: 800 !important;
    color: #101828 !important;
  }

  .greeting-heading .greeting-name {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #101828 !important;
  }

  .greeting-heading .greeting-date {
    font-size: 10.5px !important;
    color: var(--text-muted) !important;
    font-weight: 500 !important;
  }

  .topbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    width: auto !important;
  }

  /* Horizontal Swipeable Segmented Filter Bars (1-Row Clean SaaS) */
  .date-filter-group,
  .workspace-tabs-bar,
  .client-filter-pill-bar,
  .bento-tabs-group,
  .task-services-track,
  .touch-swipe-x,
  .segmented-control,
  .segmented-control-container,
  #status-filter-group {
    background: #F3F4F6 !important;
    padding: 3px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    border: none !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .date-filter-group::-webkit-scrollbar,
  .workspace-tabs-bar::-webkit-scrollbar,
  .client-filter-pill-bar::-webkit-scrollbar,
  .bento-tabs-group::-webkit-scrollbar,
  .task-services-track::-webkit-scrollbar,
  .touch-swipe-x::-webkit-scrollbar,
  .segmented-control::-webkit-scrollbar,
  .segmented-control-container::-webkit-scrollbar,
  #status-filter-group::-webkit-scrollbar {
    display: none !important;
  }

  .filter-btn,
  .workspace-tab-btn,
  .client-filter-pill,
  .bento-tab-btn,
  .task-service-pill,
  .tab-btn,
  .segmented-tab-btn,
  .segmented-control-item {
    background: transparent !important;
    border: none !important;
    color: #6B7280 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
  }

  .filter-btn.active,
  .workspace-tab-btn.active,
  .client-filter-pill.active,
  .bento-tab-btn.active,
  .task-service-pill.active,
  .tab-btn.active,
  .segmented-tab-btn.active,
  .segmented-control-item.active {
    background: #FFFFFF !important;
    border: none !important;
    color: #111827 !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08) !important;
  }

  .topbar-actions .btn-create-invoice {
    flex-shrink: 0 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    padding: 7px 12px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    width: auto !important;
  }

  /* KPI Cards: 2-Column Grid with Proportional Sizing */
  .kpi-grid,
  .kala-grid-kpi,
  .portal-stats-grid,
  .alert-cards-grid,
  .bento-metrics-grid,
  .quick-actions-bar,
  .kpi-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
  }

  /* Odd-numbered cards span 2 columns smoothly */
  .kpi-row > *:last-child:nth-child(odd),
  .kpi-grid > *:last-child:nth-child(odd),
  .bento-metrics-grid > *:last-child:nth-child(odd) {
    grid-column: span 2 !important;
  }

  .kpi-card,
  .portal-stat-card,
  .bento-metric-card,
  .alert-card,
  .quick-action-card,
  .kpi-tile {
    padding: 12px 14px !important;
    border-radius: 16px !important;
    min-height: auto !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .kpi-value,
  .metric-value,
  .bento-metric-value,
  .portal-stat-card .value,
  .count,
  #kpi-revenue, #kpi-expense, #kpi-profit, #kpi-receivables,
  #kpi-total, #kpi-revision, #kpi-review, #kpi-progress, #kpi-approved,
  #stat-total-tasks, #stat-review-tasks, #stat-progress-tasks, #stat-approved-tasks {
    font-size: 17px !important;
    line-height: 1.25 !important;
    letter-spacing: -0.3px !important;
    font-weight: 800 !important;
    word-break: break-word !important;
  }

  .metric-num {
    font-size: 20px !important;
    font-weight: 800 !important;
  }

  .kpi-title,
  .metric-label,
  .bento-metric-label,
  .portal-stat-card .label,
  .alert-card-info h5,
  .action-title {
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .kpi-meta,
  .portal-stat-card > span,
  .action-desc,
  .kpi-tile > span,
  .metric-subtitle {
    font-size: 10px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .kpi-icon,
  .card-icon-badge {
    width: 28px !important;
    height: 28px !important;
    font-size: 13px !important;
  }

  /* Responsive Panels & Single Column Stacking */
  .owner-dashboard-grid,
  .kala-dashboard-bottom-grid,
  .settings-grid,
  .kala-grid-2col,
  .kala-grid-2col-equal,
  .kala-grid-3col {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .owner-dashboard-grid > *,
  .kala-dashboard-bottom-grid > *,
  .settings-grid > *,
  .kala-grid-2col > *,
  .kala-grid-2col-equal > *,
  .glass-panel,
  .card,
  .panel,
  .bento-table-card,
  .untitled-card {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .owner-full-width-panel {
    grid-column: span 1 !important;
    margin-top: 14px !important;
  }

  .glass-panel {
    padding: 16px 14px !important;
    border-radius: 18px !important;
    margin-bottom: 14px !important;
  }

  .cashflow-chart-container {
    height: 230px !important;
    width: 100% !important;
  }

  .panel-header,
  .card-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .panel-header > div,
  .card-header > div {
    min-width: 0 !important;
  }

  .panel-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
  }

  /* Universal Table Responsive & Kala Table Scroll */
  .kala-table-scroll,
  .table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    touch-action: pan-x pan-y !important;
    padding-bottom: 6px !important;
    border-radius: 12px !important;
    margin-bottom: 12px !important;
    border: 1px solid #ECEEF5 !important;
    background: #FFFFFF !important;
  }

  .kala-table-scroll table,
  .table-responsive table,
  .table-responsive > table,
  .table-responsive > .table-custom,
  .table-responsive > .bento-table,
  main table {
    width: 100% !important;
    min-width: 680px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  .kala-table-scroll th,
  .kala-table-scroll td,
  .table-custom th,
  .table-custom td,
  .bento-table th,
  .bento-table td,
  main table th,
  main table td {
    white-space: nowrap !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    vertical-align: middle !important;
  }

  /* Off-Canvas Slide-In Sidebar Drawer on Smartphone */
  aside.sidebar,
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    background: #FFFFFF !important;
    transform: translate3d(-105%, 0, 0) !important;
    transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 0 0 12px 0 !important;
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.15) !important;
  }

  aside.sidebar.open,
  aside.sidebar.sidebar-open,
  .sidebar.open,
  .sidebar.sidebar-open {
    transform: translate3d(0, 0, 0) !important;
  }

  .sidebar-header {
    padding: 14px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid #ECEEF5 !important;
    flex-shrink: 0 !important;
  }

  .sidebar-close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    border: none !important;
    background: #F2F4F7 !important;
    color: #344054 !important;
    cursor: pointer !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
  }

  .sidebar-nav {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 10px 12px !important;
  }

  .sidebar-nav .nav-link {
    min-height: 40px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    font-size: 13.5px !important;
  }

  .sidebar-user {
    padding: 12px 14px !important;
    border-top: 1px solid #ECEEF5 !important;
    background: #F8F9FC !important;
    border-radius: 14px !important;
    margin: 8px 12px 12px !important;
  }

  /* Payroll & Ads Grids */
  .payroll-cards-grid,
  .ads-projects-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Content Calendar (Kalender Konten) */
  .supitar-calendar-card,
  .calendar-layout-wrapper {
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }

  .supitar-sidebar,
  .calendar-sidebar-card {
    width: 100% !important;
    min-width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #EAECF0 !important;
    padding: 16px 14px !important;
  }

  .supitar-main-panel,
  .calendar-main-card {
    width: 100% !important;
    padding: 14px 12px !important;
    min-width: 0 !important;
  }

  .supitar-topbar,
  .cal-top-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .supitar-topbar-left,
  .cal-nav-group {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .calendar-scroll-wrapper,
  .calendar-main-card {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .supitar-fc-container,
  .calendar-main-card .fc,
  #calendar {
    min-width: 600px !important;
  }

  /* Client Portal Mobile Hero & Content */
  .portal-hero {
    padding: 18px 16px !important;
    border-radius: 18px !important;
  }

  .portal-hero h1,
  .portal-hero .portal-hero-title {
    font-size: 17px !important;
  }

  .portal-hero-top {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
}

/* ==========================================================================
   3. MODAL POPUP SYSTEM (@media max-width: 640px)
   ========================================================================== */
@media (max-width: 640px) {
  .modal {
    padding: 8px !important;
    z-index: 100000 !important;
  }

  .modal-dialog,
  .modal-confirm-dialog {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 90dvh !important;
    overflow-y: auto !important;
    padding: 18px 14px !important;
    margin: 8px auto !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
  }

  .modal-header {
    padding: 12px 14px !important;
  }

  .modal-body {
    padding: 12px 14px !important;
  }

  .modal-footer {
    padding: 12px 14px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .form-row,
  .kala-form-row,
  .confirm-modal-actions,
  .kala-feedback-type-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .form-row > .form-group,
  .kala-form-row > .form-group {
    width: 100% !important;
  }
}

/* ==========================================================================
   4. ULTRA-COMPACT MOBILE SYSTEM (@media max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .content-body {
    padding: 10px 12px !important;
  }

  .kpi-grid,
  .kala-grid-kpi,
  .portal-stats-grid,
  .alert-cards-grid,
  .bento-metrics-grid,
  .quick-actions-bar,
  .kpi-row {
    gap: 8px !important;
  }

  .kpi-card,
  .portal-stat-card,
  .bento-metric-card,
  .alert-card,
  .quick-action-card,
  .kpi-tile {
    padding: 10px 12px !important;
  }

  .kpi-value,
  .metric-value,
  .bento-metric-value,
  .portal-stat-card .value,
  .count,
  #kpi-revenue, #kpi-expense, #kpi-profit, #kpi-receivables {
    font-size: 15.5px !important;
  }

  .panel-title {
    font-size: 13px !important;
  }

  .glass-panel {
    padding: 14px 12px !important;
    border-radius: 16px !important;
  }
}

/* ==========================================================================
   9. CONTENT CALENDAR & PLANNER WORKSPACE
   ========================================================================== */
.calendar-layout-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

.calendar-sidebar-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-search-box {
  position: relative;
}

.calendar-search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.calendar-search-box input {
  padding-left: 32px !important;
  font-size: 12.5px;
}

/* Mini Date Picker Month Navigator */
.mini-cal-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #FAFAFA;
}

.mini-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.mini-cal-title {
  font-size: 13px;
  font-weight: 700;
  color: #101828;
}

.mini-cal-nav-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #344054;
  transition: var(--transition);
}

.mini-cal-nav-btn:hover {
  background: #F2F4F7;
  color: #101828;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.mini-cal-day-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}

.mini-cal-day-cell {
  font-size: 11px;
  font-weight: 500;
  color: #344054;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.mini-cal-day-cell:hover {
  background: #E4E7EC;
}

.mini-cal-day-cell.other-month {
  color: #D0D5DD;
}

.mini-cal-day-cell.is-today {
  background: #EFF8FF;
  color: #175CD3;
  font-weight: 700;
  border: 1px solid #B2DDFF;
}

.mini-cal-day-cell.is-selected {
  background: #5D76F5 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(93, 118, 245, 0.35);
}

/* Client Filter Section */
.client-filter-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.client-filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.client-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.client-filter-item:hover {
  background: #F9FAFB;
  border-color: #D0D5DD;
}

.client-filter-item.active {
  background: #F8FAFC;
}

.client-filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.client-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.client-filter-name {
  font-size: 12px;
  font-weight: 600;
  color: #344054;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Preset Color Dots */
.color-preset-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #D0D5DD;
  cursor: pointer;
  transition: var(--transition);
}

.color-preset-dot:hover {
  transform: scale(1.15);
}

/* Main Calendar Card & Header */
.calendar-main-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

.cal-top-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.cal-nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-current-title {
  font-size: 20px;
  font-weight: 800;
  color: #101828;
  letter-spacing: -0.3px;
}

.cal-btn-pill {
  background: #FFFFFF;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-xs);
}

.cal-btn-pill:hover {
  background: #F9FAFB;
  color: #101828;
  border-color: #98A2B3;
}

.cal-view-selector {
  display: flex;
  background: #EEF0F6;
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
  border: 1px solid #ECEEF5;
}

.cal-view-btn {
  background: transparent;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: #6E7485;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}

.cal-view-btn.active {
  background: #5D76F5 !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(93, 118, 245, 0.25) !important;
}

/* FullCalendar Custom Theme Overrides */
.fc {
  font-family: inherit !important;
  --fc-border-color: #EAECF0 !important;
  --fc-page-bg-color: #FFFFFF !important;
  --fc-today-bg-color: rgba(59, 130, 246, 0.04) !important;
}

.fc-theme-standard th {
  background: #F9FAFB !important;
  border-color: #EAECF0 !important;
  padding: 10px 0 !important;
}

.fc-col-header-cell-cushion {
  color: #475467 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  text-decoration: none !important;
}

.fc-daygrid-day-top {
  padding: 4px 6px !important;
}

.fc-daygrid-day-number {
  color: #344054 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  padding: 2px 6px !important;
  border-radius: 4px;
}

.fc-daygrid-day:hover {
  background: #FAFAFA;
}

/* Custom Calendar Event Cards */
.fc-event {
  border: none !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1) !important;
  padding: 4px 6px !important;
  margin-bottom: 3px !important;
  cursor: pointer !important;
  transition: transform 0.15s var(--ease-out-natural, cubic-bezier(0.22, 1, 0.36, 1)), box-shadow 0.15s ease, filter 0.15s ease !important;
}

.fc-event:hover {
  transform: translateY(-1px) scale(1.01) !important;
  box-shadow: 0 4px 8px rgba(16, 24, 40, 0.15) !important;
  filter: brightness(1.05);
}

.km-event-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #FFFFFF;
  text-align: left;
  line-height: 1.2;
}

.km-event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.95;
}

.km-event-platform {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 4px;
  border-radius: 3px;
}

.km-event-time {
  font-size: 9px;
  opacity: 0.85;
}

.km-event-title {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.km-event-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  opacity: 0.9;
  margin-top: 2px;
}

.km-event-status-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}

/* Payroll Cards Grid & Ads Project Grid (Desktop defaults) */
.payroll-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.ads-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

/* ==========================================================================
   CLIENT SOCIAL MEDIA REPORTING & PRINT MEDIA STYLES
   ========================================================================== */
.hover-underline:hover {
  text-decoration: underline !important;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm 10mm 12mm;
  }
  *, *:before, *:after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  body, html {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .sidebar,
  .topbar,
  .invoice-actions-bar,
  .report-actions-bar,
  #sidebar-toggle,
  .btn,
  .modal-backdrop,
  .nav-section-title {
    display: none !important;
  }
  .app-container,
  .main-wrapper,
  .report-screen-wrapper,
  .report-container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    border: none !important;
    box-shadow: none !important;
  }
  .report-paper {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }
}

/* ==========================================================================
   PORTAL KALA - MOBILE BOTTOM NAVIGATION & PWA INSTALL BANNER STYLES
   ========================================================================== */

/* PWA Mobile Install Banner / Floating Sheet */
.pwa-install-banner {
  position: fixed;
  bottom: 74px;
  left: 12px;
  right: 12px;
  max-width: 460px;
  margin: 0 auto;
  z-index: 9998;
  animation: slideUpPwa 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpPwa {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pwa-banner-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-banner-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
}

.pwa-banner-close:hover {
  color: #111827;
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 20px;
}

.pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.pwa-banner-text {
  min-width: 0;
}

.pwa-banner-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
}

.pwa-banner-desc {
  margin: 2px 0 0 0;
  font-size: 11.5px;
  color: #4B5563;
  line-height: 1.35;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-pwa-dismiss {
  background: transparent;
  border: none;
  color: #6B7280;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-pwa-dismiss:hover {
  background: #F3F4F6;
  color: #111827;
}

.btn-pwa-install-action {
  background: #2563EB;
  color: #FFFFFF;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
  transition: background-color 150ms ease, transform 150ms ease;
}

.btn-pwa-install-action:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

/* iOS Safari Instruction Modal */
.pwa-ios-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pwa-ios-card {
  background: #FFFFFF;
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.pwa-ios-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #FFFFFF;
  border-top: 1px solid #EAECEF;
  box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.04);
  z-index: 990;
  padding: 0 6px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
    align-items: center;
    justify-content: space-around;
  }

  /* Add extra padding at the bottom of main-wrapper so content isn't covered by bottom nav */
  .main-wrapper,
  .content-body,
  .app-container {
    padding-bottom: 68px !important;
  }
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #64748B;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  transition: color 150ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mob-nav-item:hover,
.mob-nav-item:focus {
  color: #2563EB;
}

.mob-nav-item.active {
  color: #2563EB;
}

.mob-nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mob-nav-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin="round";
}

.mob-nav-item.active .mob-nav-icon svg {
  stroke-width: 2.3;
}

.mob-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.1px;
  margin-top: 3px;
  line-height: 1;
}

.mob-nav-item.active .mob-nav-label {
  font-weight: 700;
}


