/* ==========================================================================
   Dispatch Management System - Core Stylesheet
   Theme: Vibrant Sky Aasmani (Top) to Pure Pitch Black (Bottom)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #00B4DB;         /* Vivid Aasmani Accent */
  --primary-hover: #0083B0;   
  --primary-light: #E0F7FA;   

  /* MENU BAR BACKGROUND COLOR & THEME STYLES */
  --menu-gradient: linear-gradient(180deg, #1E293B 0%, #0F172A 100%); 
  --menu-hover-bg: rgba(255, 255, 255, 0.1);                                       /* Soft white hover glow */
  --menu-active-gradient: linear-gradient(90deg, #00B4DB 0%, #0083B0 100%);        /* Bright Aasmani Active Bar */
  --menu-text-muted: #94A3B8;                                                      /* Crisp Slate Muted Text */
  --menu-text-bright: #FFFFFF;                                                     /* Pure White Text */

  --secondary: #64748B;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --sidebar-width: 260px;
  --header-height: 65px;
  
  /* Sharp Edges */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ==========================================================================
   Layout Structures & Sidebar Navigation
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-left: var(--sidebar-width);
  transition: var(--transition);
}

.main-content {
  padding: 1.75rem;
  flex: 1;
}

/* Clear Vibrant Aasmani (Top) & Pure Pitch Black (Bottom) */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--menu-gradient);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 6px 0 25px rgba(0, 0, 0, 0.6);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  gap: 0.75rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(0, 180, 219, 0.7);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--menu-text-bright);
  letter-spacing: 0.3px;
}

.sidebar-menu {
  padding: 0.85rem 0;
  overflow-y: auto;
  flex: 1;
}

.menu-category {
  padding: 0.9rem 1.25rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--menu-text-muted);
  letter-spacing: 0.8px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.725rem 1.25rem;
  color: #FFFFFF;
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--transition);
  gap: 0.85rem;
  border-left: 4px solid transparent;
}

.nav-link:hover {
  color: var(--menu-text-bright);
  background: var(--menu-hover-bg);
  border-left-color: #00B4DB;
  padding-left: 1.4rem;
}

.nav-link.active {
  color: #FFFFFF;
  background: var(--menu-active-gradient);
  border-left-color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 180, 219, 0.6);
}

.nav-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

/* Submenu / Dropdown Styling */
.submenu-toggle-btn {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.submenu-toggle-btn .submenu-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  color: rgba(255, 255, 255, 0.7);
}

.submenu-toggle-btn[aria-expanded="true"] .submenu-arrow {
  transform: rotate(90deg);
}

.submenu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: rgba(0, 0, 0, 0.2);
}

.submenu-list.show {
  max-height: 500px; /* High enough to contain all items */
  transition: max-height 0.3s ease-in;
}

.submenu-list .nav-link {
  padding-left: 2.5rem;
  font-size: 0.825rem;
  background: transparent;
}

.submenu-list .nav-link:hover {
  padding-left: 2.75rem;
  background: var(--menu-hover-bg);
}

.submenu-list .nav-link.active {
  background: var(--menu-active-gradient);
}

/* Top Navbar */
.top-navbar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  width: 300px;
  gap: 0.5rem;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-main);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.05rem;
  color: var(--secondary);
  cursor: pointer;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--bg-main);
  color: var(--primary);
}

.badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.user-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-info span {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* UI Elements */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.icon-blue { background: var(--primary-light); color: var(--primary); }
.icon-green { background: #E6F4EA; color: var(--success); }
.icon-orange { background: #FEF3C7; color: var(--warning); }
.icon-red { background: #FEE2E2; color: var(--danger); }

.card-details h3 {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.card-details .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.1rem;
}

.content-block {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.block-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.custom-table th {
  background: var(--bg-main);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.custom-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  white-space: normal;
  overflow-wrap: break-word;
}

.custom-table tbody tr:hover {
  background-color: var(--primary-light);
}

.badge {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #E0F2FE; color: #075985; }
.badge-secondary { background: #F1F5F9; color: #64748B; }
.badge-indigo { background: #6366F1; color: #FFFFFF; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--menu-gradient);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-primary i {
  color: #ffffff !important;
}

.btn-primary:hover {
  background: var(--menu-active-gradient);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 180, 219, 0.4);
}

.btn-primary:hover i {
  color: #ffffff !important;
}

.btn-secondary {
  background: var(--menu-gradient);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary i {
  color: #ffffff !important;
}

.btn-secondary:hover {
  background: var(--menu-active-gradient);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 180, 219, 0.4);
}

.btn-secondary:hover i {
  color: #ffffff !important;
}

.btn-success {
  background: var(--menu-gradient);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-success i {
  color: #ffffff !important;
}

.btn-success:hover {
  background: var(--menu-active-gradient);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 180, 219, 0.4);
}

.btn-success:hover i {
  color: #ffffff !important;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-group label,
.form-label-custom {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 180, 219, 0.2);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.15rem;
}

/* Responsive Dashboard and Filter Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
}

.dashboard-grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: flex-end;
}

@media (max-width: 1024px) {
  .dashboard-grid, 
  .dashboard-grid-equal {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }
}

/* ==========================================================================
   Utility & Helper Classes (Refactored from Inline Styles)
   ========================================================================== */

/* Layout & Flex Utilities */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none !important; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.5rem; }

/* Sizing Utilities */
.w-100 { width: 100%; }
.w-auto { width: auto; }
.col-srno { width: 60px; }
.h-100 { height: 100%; }
.max-w-100 { max-width: 100%; }
.max-w-none { max-width: none !important; }

/* Spacing Utilities */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.ml-auto { margin-left: auto; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.5rem; }

/* Typography & Colors */
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.text-white { color: #ffffff !important; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semi { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.825rem; }
.text-base { font-size: 0.9rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.4rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-underline-none { text-decoration: none; }

/* Page Header Structure */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.page-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}
.page-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
}
.back-link {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Master Form Styles */
.form-title {
  margin-bottom: 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
}
.form-title i {
  color: var(--primary);
  margin-right: 0.5rem;
}
.form-grid-four-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-grid-four-col label,
.form-grid-three-col label,
.form-grid-two-col label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.form-grid-four-col input,
.form-grid-three-col input,
.form-grid-two-col input,
.form-grid-four-col select,
.form-grid-three-col select,
.form-grid-two-col select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.form-grid-three-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-grid-two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: end;
}
.form-submit-container {
  display: flex;
  justify-content: flex-end;
}
.form-submit-btn {
  padding: 0.6rem 2rem;
  width: 100%;
  justify-content: center;
  height: 38px;
}
.alert-success {
  background-color: var(--primary-light);
  color: var(--primary-hover);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--primary);
  font-size: 0.875rem;
}
.alert-danger {
  background-color: #FEF2F2;
  color: #991B1B;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid #FCA5A5;
  font-size: 0.875rem;
}
.badge-customer {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-hover);
}
.badge-supplier {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: #FEF3C7;
  color: #92400E;
}

/* User Roles Permission Hierarchy */
.perm-menu-group {
  border-bottom: 1px solid var(--border-color);
}
.perm-menu-group:last-child { border-bottom: none; }

.perm-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: var(--primary-light, #eef4ff);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
}
.perm-menu-header:hover { background: #dde9ff; }

.perm-arrow {
  font-size: 0.7rem;
  color: var(--primary);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.perm-menu-header.collapsed .perm-arrow { transform: rotate(-90deg); }

.perm-submenu-container { display: block; }
.perm-submenu-container.collapsed { display: none; }

.perm-submenu-group {
  border-bottom: 1px solid #f0f0f0;
}
.perm-submenu-group:last-child { border-bottom: none; }

.perm-submenu-header {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  background: #f9faff;
  border-bottom: 1px solid #f0f0f0;
}
.perm-submenu-header:hover { background: #f0f4ff; }

.perm-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.5rem;
  padding: 0.5rem 0.75rem 0.5rem 3rem;
  background: #fff;
}

.perm-item-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  transition: background 0.15s;
}
.perm-item-label:hover { background: #f0f4ff; }
.perm-item-label input[type="checkbox"] { accent-color: var(--primary); }

/* Custom Modal Components (Change Password, etc.) */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeInModal 0.25s ease-out;
}

.custom-modal-container {
  background-color: #ffffff;
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #E2E8F0;
  overflow: hidden;
  animation: slideUpModal 0.25s ease-out;
}

.custom-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #E2E8F0;
}

.custom-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.custom-modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #94A3B8;
  cursor: pointer;
  transition: color 0.15s ease;
  padding: 0;
  line-height: 1;
}

.custom-modal-close-btn:hover {
  color: #64748B;
}

.custom-modal-body {
  padding: 20px;
}

.form-group-custom {
  margin-bottom: 16px;
}

.label-custom {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

.input-wrapper-custom {
  position: relative;
  display: flex;
  align-items: center;
}

.input-custom {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  font-size: 14px;
  color: #0F172A;
  background-color: #FFF;
  transition: all 0.15s ease-in-out;
}

.input-custom:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 237, 0.15);
}

.pwd-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.pwd-toggle-btn:hover {
  color: #64748B;
}

.custom-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #E2E8F0;
}

.btn-custom {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.custom-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.custom-alert.error {
  background-color: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

.custom-alert.success {
  background-color: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.spinner-custom {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin-custom 0.8s linear infinite;
}

@keyframes spin-custom {
  to { transform: rotate(360deg); }
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpModal {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Print Utility Styles */
@media print {
  body * {
    visibility: hidden;
  }
  .print-area, .print-area * {
    visibility: visible;
  }
  .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .no-print {
    display: none !important;
  }
}

/* Report & Data Table Component Styles */
.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  white-space: nowrap;
}
.status-badge.verified {
  background-color: #DCFCE7;
  color: #22C55E;
}
.status-badge.pending {
  background-color: #FEE2E2;
  color: #EF4444;
}

.report-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.01);
  display: flex;
  flex-direction: column;
}

.filter-panel {
  padding: 20px 24px;
  background-color: #FAFCFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.date-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-input {
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}
.date-input:focus {
  border-color: var(--primary);
}

.search-box-wrapper {
  position: relative;
  width: 280px;
}
.search-box-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 180, 219, 0.1);
}

.select-dropdown {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background-color: #FFFFFF;
  outline: none;
  cursor: pointer;
}

.enterprise-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.enterprise-table th {
  background-color: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  white-space: nowrap;
}
.enterprise-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 13px;
}
.enterprise-table tbody tr:hover {
  background-color: #F8FAFC;
}

.pagination-panel {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FAFCFF;
  flex-wrap: wrap;
  gap: 12px;
}

.table-info-text {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.page-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  background-color: #FFFFFF;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: var(--transition);
}

/* Standalone Login Pages Styling */
.login-container-standalone {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #2d768a 100%);
  padding: 1.5rem;
}

.login-card-standalone {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: 0 15px 30px rgba(0,0,0,0.25);
}

.login-illustration-standalone {
  background: #EFF6FF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  text-align: center;
  border-right: 1px solid var(--border-color);
}

.login-form-area-standalone {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-logo-standalone {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 1.25rem;
}

.btn-portal-submit {
  width: 100%;
  justify-content: center;
  padding: 0.65rem;
  background: linear-gradient(135deg, #1a73e8 0%, #6c3fc5 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(108, 63, 197, 0.4);
  transition: all 0.3s ease;
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.btn-portal-submit:hover {
  background: linear-gradient(135deg, #1557b0 0%, #5230a0 100%);
  box-shadow: 0 6px 20px rgba(108,63,197,0.6);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .login-card-standalone {
    grid-template-columns: 1fr;
  }
  .login-illustration-standalone {
    display: none;
  }
}

/* Party Ledger Modal & Summary Grid Styles */
.party-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  background: var(--bg-main);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.summary-box h5 {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.summary-box p {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.btn-view {
  background-color: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.btn-view:hover {
  background-color: var(--primary);
  color: #FFFFFF;
}
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: var(--transition);
}
.modal-backdrop.open {
  display: flex;
}
.modal-content {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 750px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  animation: modalSlideUp 0.3s ease-out;
  overflow: hidden;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #F8FAFC;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.modal-close-btn:hover {
  color: var(--danger);
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Approval Desk & Action Panel Component Styles */
.actions-panel {
  padding: 12px 24px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-bulk-approve {
  background-color: var(--success);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.btn-bulk-approve:hover {
  background-color: #16A34A;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}
.selected-total-badge {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #BFDBFE;
  display: flex;
  gap: 15px;
}
.filter-group-left {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-group-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-approve {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-approve:hover {
  background-color: #1D4ED8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.modal-overlay,
.modal-overlay-backdrop,
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active,
.modal-overlay-backdrop.active,
.modal-backdrop.active,
.modal-overlay.open,
.modal-overlay-backdrop.open,
.modal-backdrop.open {
  display: flex;
}

.modal-card-container {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
}

.modal-card-sm {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

/* Document & Print Invoice / Challan Component Styles */
.doc-print-container {
  padding: 2.5rem;
  background: #fff;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.doc-header-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.doc-brand-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.doc-brand-logo {
  background: var(--primary);
  color: #fff;
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-address-info {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.doc-title-primary {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
}

.doc-title-success {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--success);
}

.doc-meta-table {
  font-size: 0.85rem;
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.doc-meta-table td.label-cell {
  padding: 2px 8px 2px 0;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
}

.doc-meta-table td.value-cell {
  padding: 2px 0;
  text-align: right;
}

.doc-badge-status {
  background: #F1F5F9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 700;
}

.doc-grid-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.doc-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.doc-section-heading {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.doc-section-heading-success {
  font-weight: 700;
  color: var(--success);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.doc-table th {
  padding: 0.75rem;
}

.doc-table td {
  padding: 0.75rem;
}

.doc-table tr.header-row {
  background: #F8FAFC;
  border-bottom: 2px solid var(--border-color);
}

.doc-table tr.data-row {
  border-bottom: 1px solid var(--border-color);
}

.doc-table tr.footer-row {
  background: #EFF6FF;
  font-weight: 700;
}

.doc-signature-row {
  margin-top: 5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.doc-signature-box {
  text-align: center;
  width: 200px;
}

.doc-signature-line {
  border-bottom: 1px solid #000;
  height: 40px;
}

.doc-upload-box {
  align-self: flex-start;
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

/* Reports Dashboard Tabs & Filter Panel Component Styles */
.reports-tabs-nav {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.report-tab-btn {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
}

.report-tab-btn:hover {
  background-color: var(--bg-hover);
}

.report-tab-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.report-filter-panel {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.avatar-employee {
  background: #D1FAE5;
  color: #065F46;
}

/* ==========================================================================
   Company & Dynamic Data Table Component Styles
   ========================================================================== */
.company-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.company-kpi-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}
.company-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.company-kpi-title {
  font-size: 0.825rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
.company-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.company-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.icon-amber { 
  background: #FEF3C7; 
  color: #F59E0B; 
}

/* Dynamic Table Toolbar styling */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.search-input-group {
  position: relative;
  min-width: 260px;
}
.search-input-group i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.search-input-group input {
  padding-left: 2.35rem;
}
.sort-header {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}
.sort-header:hover {
  background-color: rgba(0, 180, 219, 0.08) !important;
}
.sort-icon {
  font-size: 0.75rem;
  margin-left: 0.4rem;
  opacity: 0.6;
}
.sort-header.active-sort .sort-icon {
  opacity: 1;
  color: var(--primary);
}

/* Empty state */
.empty-table-container {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-table-icon {
  font-size: 3rem;
  color: #CBD5E1;
  margin-bottom: 1rem;
}

/* Pagination styling */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 0.875rem;
}
.pagination-buttons {
  display: flex;
  gap: 0.35rem;
}
.page-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.page-btn:hover:not(:disabled) {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
.page-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Badges & Button Groups */
.badge-code {
  background-color: var(--primary-light);
  color: var(--primary-hover);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.action-btn-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Helper Utility Classes for Views */
.alert-dismiss-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
}
.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}
.select-auto {
  width: auto;
  min-width: 140px;
}
.select-page-size {
  width: auto;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}
.page-size-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.content-block-table {
  margin-top: 0;
  border-radius: 0;
  border-top: none;
  padding: 0;
}
.custom-table-flat {
  margin: 0;
}
.th-id {
  width: 60px;
}
.th-actions {
  text-align: right;
  width: 140px;
}
.td-actions {
  text-align: right;
}
.showing-info {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.modal-header-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}
.modal-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.modal-grid-2col-gap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-label-block {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: block;
}
.form-control-uppercase {
  text-transform: uppercase;
}
.form-group-mb {
  margin-bottom: 1rem;
}
.form-checkbox-group {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.custom-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.custom-checkbox-label {
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}
.modal-footer-custom {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}
.modal-footer-center {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}
.modal-container-md {
  max-width: 600px;
  width: 90%;
}
.modal-container-sm {
  max-width: 500px;
  width: 90%;
}
.modal-container-delete {
  max-width: 440px;
  width: 90%;
  text-align: center;
}
.delete-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FEE2E2;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1rem auto;
}
.delete-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.delete-modal-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.view-details-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.view-id-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-main);
  padding: 0.75rem 1rem;
  border-radius: 6px;
}
.view-field-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 0.2rem;
}
.view-field-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}
.view-field-text {
  font-size: 0.9rem;
  color: var(--text-main);
}
.view-address-box {
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--bg-main);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
}
.table-address-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-action-icon {
  padding: 0.35rem 0.6rem;
}
.btn-action-delete {
  padding: 0.35rem 0.6rem;
  color: var(--danger);
}
.pagination-dots {
  padding: 0.2rem 0.4rem;
  color: var(--text-muted);
}
.empty-table-title {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}
.empty-table-text {
  font-size: 0.85rem;
  max-width: 400px;
  margin: 0 auto 1.25rem auto;
}
.cell-company-name {
  color: var(--text-main);
  font-size: 0.95rem;
}
.action-group-end {
  justify-content: flex-end;
}
.display-none {
  display: none;
}

/* ==========================================================================
   Customer Master & Form Component Styles
   ========================================================================== */
.user-type-selection-box {
  margin-bottom: 1.25rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  background: var(--bg-light, #f8fafc);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-color);
}
.user-type-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dark);
}
.user-type-options {
  display: flex;
  gap: 1.5rem;
}
.user-type-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  margin-bottom: 0;
}
.user-type-checkbox {
  width: auto;
  height: auto;
  transform: scale(1.1);
  margin: 0;
}
.form-grid-equal-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-checkbox-label {
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0;
}
.form-textarea-address {
  width: 100%;
  height: 80px;
}

/* ==========================================================================
   Searchable Select Dropdown (SSD) & Invoice Component Styles
   ========================================================================== */
.ssd-wrapper {
  position: relative;
}
.ssd-trigger {
  padding: 0.55rem 0.75rem;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-md, 8px);
  background: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  min-height: 38px;
  user-select: none;
  transition: all 0.15s ease;
}
.ssd-trigger:hover {
  border-color: #2563EB;
}
.ssd-label {
  color: #64748b;
  font-weight: 500;
}
.ssd-label.selected {
  color: #0f172a;
}
.ssd-caret {
  color: #94a3b8;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}
.ssd-caret.open {
  transform: rotate(180deg);
}
.ssd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1050;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  overflow: hidden;
}
.ssd-menu.open {
  display: block;
}
.ssd-search-box {
  padding: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.ssd-search-input {
  width: 100%;
  padding: 0.4rem 0.65rem;
  font-size: 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
}
.ssd-search-input:focus {
  border-color: #2563EB;
}
.ssd-options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}
.ssd-opt {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  transition: background 0.15s ease;
}
.ssd-opt:hover {
  background: #f1f5f9;
}
.ssd-opt .opt-main {
  font-weight: 600;
  color: #1e293b;
}
.ssd-opt .opt-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}
.ssd-no-result {
  padding: 0.75rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

.create-inv-card {
  background: #ffffff;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 4px 20px -2px rgba(0,0,0,0.05);
  border: 1px solid #E2E8F0;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.form-label-custom {
  font-size: 0.825rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
  display: block;
}
.form-input-custom {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-md, 8px);
  background: #FFFFFF;
  transition: all 0.15s ease;
}
.form-input-custom:focus {
  border-color: #2563EB;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.inv-summary-box {
  background: linear-gradient(135deg, #1E293B, #0F172A);
  color: #FFFFFF;
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25);
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.inv-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.inv-summary-line span:first-child {
  white-space: nowrap;
  flex-shrink: 0;
}
.inv-summary-line span:last-child {
  white-space: nowrap;
  text-align: right;
  word-break: break-all;
}
.inv-summary-line.total {
  border-bottom: none;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #60A5FA;
}

/* ==========================================================================
   Modal & Analytical Helper Styles
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-content-custom {
  background: #ffffff;
  width: 90%;
  max-width: 680px;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header-custom {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header-custom .modal-header-title,
.modal-header-custom .modal-header-title i,
.modal-header-custom .modal-close-btn,
.modal-header-custom .text-primary {
  color: #ffffff !important;
}
.modal-header-custom .modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  opacity: 0.85;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.modal-header-custom .modal-close-btn:hover {
  opacity: 1;
  color: #ffffff !important;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #1E293B;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.qty-btn:hover {
  background: #2563EB;
  color: #ffffff;
  border-color: #2563EB;
}
.icon-emerald { background: #ECFDF5; color: #10B981; }
.icon-amber { background: #FFFBEB; color: #F59E0B; }
.col-actions { width: 140px; }
.filter-select-w { width: 180px; }
.search-input-w { flex: 1; min-width: 200px; }

/* Create PO Form & Item Grid Helpers */
.section-divider {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}
.item-add-box {
  background: #F8FAFC;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.form-grid-one-two {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.item-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: flex-end;
}
.input-readonly-taxable {
  background: #F1F5F9 !important;
  font-weight: 600;
}
.input-readonly-gst {
  background: #FFF7ED !important;
  font-weight: 600;
  color: #D97706 !important;
}
.input-readonly-total {
  background: #EFF6FF !important;
  font-weight: 700;
  color: var(--primary) !important;
}
.table-foot-total {
  background: #EFF6FF;
  font-weight: 700;
}
.bg-slate-light {
  background: #F1F5F9 !important;
}
.pos-relative {
  position: relative;
}

/* PO Invoice Styles */
.invoice-card {
  background: #ffffff;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.03);
  border: 1px solid var(--border-color, #E2E8F0);
  padding: 2.5rem;
  margin-top: 1rem;
  color: #1e293b;
}
.invoice-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 1.5rem;
}
.invoice-title-badge {
  text-align: right;
}
.invoice-title-badge h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
.invoice-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.invoice-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.invoice-box h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}
.invoice-table th {
  background-color: #1e3a5f;
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-size: 0.825rem;
  font-weight: 600;
  text-align: left;
  border-top: 1px solid #1e3a5f;
}
.invoice-table td {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #E2E8F0;
  color: #334155;
}
.invoice-table tr:nth-child(even) {
  background-color: #F8FAFC;
}
.invoice-summary-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
}
.bank-details-box {
  flex: 1;
  background: #F1F5F9;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  border: 1px dashed #CBD5E1;
}
.calculation-table {
  width: 320px;
  border-collapse: collapse;
}
.calculation-table td {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}
.calculation-table tr.grand-total td {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e3a5f;
  background: #EFF6FF;
  border-top: 2px solid #2563EB;
  border-bottom: 2px solid #2563EB;
}
.stepper-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  background: #F1F5F9;
  color: #1E293B;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}
.stepper-btn:hover {
  background: #2563EB;
  color: #fff;
  border-color: #2563EB;
}

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #fff !important;
  }
  .invoice-card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  .sidebar, .top-navbar {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }
}

/* Detailed Invoice Classes (Replacing inline styles) */
.invoice-back-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.invoice-main-title {
  font-size: 1.4rem;
  font-weight: 700;
}
.invoice-action-btns {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.invoice-po-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.invoice-po-select-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}
.invoice-po-select {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 6px;
  min-width: 180px;
}
.btn-adjust-qty {
  padding: 0.45rem 1rem;
  background: #F59E0B;
  color: #fff;
  border: none;
  font-weight: 600;
}
.btn-invoice-action {
  padding: 0.45rem 1rem;
}
.edit-save-bar {
  display: none;
  background: #EFF6FF;
  border: 1px solid #93C5FD;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  align-items: center;
  justify-content: space-between;
}
.edit-save-text {
  color: #1E3A8A;
  font-weight: 600;
  font-size: 0.9rem;
}
.edit-save-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}
.btn-sm-custom {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
}
.btn-save-custom {
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: #2563EB;
}
.invoice-brand-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.invoice-brand-logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.invoice-company-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e3a5f;
  margin: 0;
}
.invoice-company-details {
  font-size: 0.825rem;
  color: #64748B;
  margin: 0.2rem 0 0 0;
}
.invoice-type-badge {
  background: #1e3a5f;
  color: #fff;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
}
.invoice-metadata-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}
.invoice-meta-label {
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 600;
  text-transform: uppercase;
}
.invoice-meta-value-primary {
  font-weight: 700;
  color: #1e3a5f;
  font-size: 0.95rem;
}
.invoice-meta-value {
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
}
.invoice-meta-value-blue {
  font-weight: 700;
  color: #2563EB;
  font-size: 0.95rem;
}
.badge-status-text {
  font-size: 0.75rem;
  color: #fff;
}
.party-title {
  color: #1e3a5f;
  font-size: 0.95rem;
}
.party-details {
  font-size: 0.825rem;
  color: #475569;
  margin-top: 0.3rem;
  line-height: 1.4;
}
.th-col-sr {
  width: 40px;
  text-align: center;
}
.th-col-qty {
  text-align: right;
  width: 160px;
}
.th-col-price {
  text-align: right;
  width: 120px;
}
.td-col-sr {
  text-align: center;
  font-weight: 600;
}
.qty-edit-controls {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}
.qty-input-edit {
  width: 55px;
  text-align: center;
  padding: 0.25rem;
  border: 1px solid #2563EB;
  border-radius: 4px;
  font-weight: 700;
  color: #1e3a5f;
}
.price-edit-controls {
  display: none;
  justify-content: flex-end;
}
.price-input-edit {
  width: 75px;
  text-align: right;
  padding: 0.25rem;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  font-size: 0.85rem;
}
.bank-details-title {
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
}
.bank-details-text {
  margin: 0 0 0.75rem 0;
  color: #475569;
  line-height: 1.5;
}
.words-display-box {
  background: #fff;
  border: 1px solid #CBD5E1;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
}
.words-display-text {
  font-weight: 700;
  color: #1e3a5f;
  font-size: 0.9rem;
  margin-top: 0.15rem;
}
.summary-label {
  color: #64748B;
  font-weight: 500;
}
.invoice-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #E2E8F0;
}
.terms-text {
  font-size: 0.775rem;
  color: #64748B;
  line-height: 1.5;
}
.sign-box {
  text-align: center;
}
.sign-line {
  border-bottom: 1px solid #94A3B8;
  width: 80%;
  margin: 3rem auto 0.5rem auto;
}
.sign-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e3a5f;
}

/* ==========================================================================
   User Roles & Permissions Styles
   ========================================================================== */
.perm-badge-pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  display: inline-block;
  white-space: nowrap;
}
.perm-more-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  display: inline-block;
  white-space: nowrap;
}
.btn-action-icon-custom {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-action-icon-custom:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-action-delete-custom:hover {
  background: #FEE2E2 !important;
  color: #DC2626 !important;
  border-color: #FCA5A5 !important;
}
.roles-layout-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .roles-layout-grid {
    grid-template-columns: 1fr;
  }
}
/* Modal Backdrop Fix */
.role-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.role-modal-container {
  background: #ffffff;
  width: 100%;
  max-width: 600px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  overflow: hidden;
  animation: slideUpModal 0.2s ease-out;
}
.role-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: #F8FAFC;
}
.role-modal-body {
  padding: 1.25rem;
  max-height: 75vh;
  overflow-y: auto;
}
.role-modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: #F8FAFC;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}