/* Modern Professional Theme - Enhanced UI/UX */
:root {
  /* Color System - WCAG AA compliant */
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --sidebar-bg: #1e40af;
  --sidebar-bg-hover: #1e3a8a;
  --header-bg: #ffffff;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --accent-lighter: #eff6ff;
  --border-color: #e2e8f0;
  --border-color-light: #f1f5f9;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: #fee2e2;
  --success: #16a34a;
  --success-hover: #15803d;
  --success-light: #dcfce7;
  --warning: #ea580c;
  --warning-light: #fed7aa;
  --info: #0284c7;
  --info-light: #e0f2fe;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
}

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

* {
  box-sizing: border-box;
}

body,
body.app-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  color: var(--text-primary);
  line-height: 1.625;
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Header Styles */
.app-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  transition: box-shadow var(--transition-base);
}

.app-header:hover {
  box-shadow: var(--shadow);
}

.brand-link {
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: transform var(--transition-fast), color var(--transition-fast);
  padding: 0.375rem 0;
}

.brand-link:hover {
  transform: translateY(-1px);
  color: var(--accent-hover);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background-color: var(--accent-lighter);
  border: 1px solid var(--accent-light);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
}

.user-profile:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.user-profile:active {
  transform: translateY(0);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.3;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--accent);
  cursor: pointer;
}

/* Desktop sidebar toggle */
.sidebar-toggle-desktop {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
}

.sidebar-toggle-desktop:hover {
  background: #f3f4f6;
  color: var(--accent-hover);
}

/* Main Layout */
.app-root {
  display: flex;
  min-height: calc(100vh - 69px);
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Main content when sidebar is collapsed */
.app-content.sidebar-collapsed {
  margin-left: 70px;
}



/* Sidebar Styles */
.app-sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-hover) 100%);
  padding: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 69px;
  height: calc(100vh - 69px);
  transition: all var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.app-sidebar::-webkit-scrollbar {
  width: 6px;
}

.app-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}

.app-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Collapsed sidebar for desktop */
.app-sidebar.collapsed {
  width: 70px;
  overflow: visible;
}

.app-sidebar.collapsed .sidebar-section-title {
  display: none;
}

.app-sidebar.collapsed .sidebar-nav a span,
.app-sidebar.collapsed .sidebar-nav a i.fa-chevron-down,
.app-sidebar.collapsed .sidebar-nav a i.fa-chevron-right,
.app-sidebar.collapsed .sidebar-nav a i.fa-chevron-up,
.app-sidebar.collapsed .sidebar-footer span {
  display: none;
}

.app-sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding: 0.75rem 1rem;
  margin: 0.125rem 0.5rem;
}

.app-sidebar.collapsed .sidebar-nav a i:first-child {
  margin-right: 0;
  font-size: 1.125rem;
}

/* Collapsed sidebar dropdown styles */
.app-sidebar.collapsed .sidebar-dropdown {
  position: relative;
}

.app-sidebar.collapsed .sidebar-dropdown-toggle {
  justify-content: center;
  padding: 0.75rem 1rem;
  margin: 0.125rem 0.5rem;
}

.app-sidebar.collapsed .sidebar-dropdown-toggle span,
.app-sidebar.collapsed .sidebar-dropdown-toggle .dropdown-icon {
  display: none;
}

.app-sidebar.collapsed .sidebar-dropdown-toggle i:first-child {
  margin-right: 0;
  font-size: 1.125rem;
}

/* Collapsed submenu as popup tooltip */
.app-sidebar.collapsed .sidebar-submenu {
  position: absolute;
  left: 100%;
  top: 0;
  width: 220px;
  margin: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: var(--sidebar-bg);
  z-index: 1000;
  display: none !important;
}

.app-sidebar.collapsed .sidebar-dropdown:hover .sidebar-submenu,
.app-sidebar.collapsed .sidebar-submenu.show {
  display: block !important;
}

.app-sidebar.collapsed .sidebar-submenu li a {
  padding: 0.625rem 1rem;
}

.app-sidebar.collapsed .sidebar-submenu li a span {
  display: inline;
}

.app-sidebar.collapsed .sidebar-footer {
  padding: 1rem 0.5rem;
}

.app-sidebar.collapsed .sidebar-footer a {
  justify-content: center;
}

.app-sidebar.collapsed .sidebar-footer a span {
  display: none;
}

/* Tooltip for collapsed menu items */
.app-sidebar.collapsed .sidebar-menu>li {
  position: relative;
}

.app-sidebar.collapsed .sidebar-menu>li>a::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  margin-left: 8px;
  z-index: 1000;
}

.app-sidebar.collapsed .sidebar-menu>li>a:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Tooltip for collapsed dropdown toggle */
.app-sidebar.collapsed .sidebar-dropdown-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  margin-left: 8px;
  z-index: 999;
}

.app-sidebar.collapsed .sidebar-dropdown:hover .sidebar-dropdown-toggle::after {
  opacity: 0;
  visibility: hidden;
}

/* Sidebar User Info (Mobile Only) */
.sidebar-user-mobile {
  display: none;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(to bottom, #fbfdff, #fff);
}

.sidebar-user-avatar {
  text-align: center;
  margin-bottom: 0.75rem;
}

.sidebar-user-avatar i {
  font-size: 3rem;
  color: var(--accent);
}

.sidebar-user-info {
  text-align: center;
}

.sidebar-user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.sidebar-user-role {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
}

.sidebar-user-role i {
  font-size: 0.75rem;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none !important;
}

.sidebar-nav li {
  list-style: none !important;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.75rem 1.25rem;
  margin: 0.125rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition-base);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: transparent;
  transition: background var(--transition-base);
}

.sidebar-nav a span {
  flex: 1;
  transition: transform var(--transition-fast);
}

.sidebar-nav a i {
  width: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(4px);
}

.sidebar-nav a:hover::before {
  background: #ffffff;
}

.sidebar-nav a:hover i {
  color: #ffffff;
  transform: scale(1.1);
}

.sidebar-nav a:hover span {
  transform: translateX(2px);
}

.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.sidebar-nav a.active::before {
  background: var(--accent);
}

.sidebar-nav a.active i {
  color: var(--accent);
}

/* Badge in sidebar */
.badge-readonly {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 99px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: auto;
  flex-shrink: 0;
}

.badge-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

/* Sidebar Dropdown */
.sidebar-nav .dropdown {
  position: relative;
}

.sidebar-nav .dropdown-toggle {
  cursor: pointer;
  width: 100%;
}

.sidebar-nav .dropdown-toggle::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(255, 255, 255, 0.9);
  transition: transform var(--transition-fast);
}

.sidebar-nav .dropdown.open .dropdown-toggle::after {
  transform: translateY(-50%) rotate(180deg);
}

.sidebar-nav .dropdown-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  background: rgba(30, 58, 138, 0.95);
  border-radius: var(--radius-md);
  margin: 0.25rem 0.75rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.sidebar-nav .dropdown.open .dropdown-menu {
  max-height: 500px;
  opacity: 1;
  padding: 0.5rem 0;
}

.sidebar-nav .dropdown-menu li {
  margin: 0;
}

.sidebar-nav .dropdown-menu a {
  padding: 0.625rem 1.5rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-nav .dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: none;
}

.sidebar-nav .dropdown-menu a.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.sidebar-nav .dropdown-menu a i {
  width: 16px;
  font-size: 0.875rem;
}

.sidebar-nav .dropdown-menu .disabled {
  pointer-events: none;
  opacity: 0.6;
}

.sidebar-nav .dropdown-menu .disabled:hover {
  background: none;
  color: rgba(255, 255, 255, 0.6);
}

/* Sidebar Dropdown Styles */
.sidebar-dropdown {
  margin-bottom: 0.5rem;
}

.sidebar-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.75rem 1.25rem;
  margin: 0.125rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition-base);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.sidebar-dropdown-toggle::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: transparent;
  transition: background var(--transition-base);
}

.sidebar-dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(4px);
}

.sidebar-dropdown-toggle:hover::before {
  background: #ffffff;
}

.sidebar-dropdown-toggle i {
  width: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.sidebar-dropdown-toggle .dropdown-icon {
  margin-left: auto;
  transition: transform var(--transition-fast);
}

.sidebar-submenu {
  list-style: none !important;
  padding: 0;
  margin: 0;
  display: none;
  background: rgba(30, 58, 138, 0.95);
  border-radius: var(--radius-md);
  margin: 0.25rem 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.sidebar-submenu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.625rem 1.5rem 0.625rem 2rem;
  font-size: 0.875rem;
  font-weight: 400;
  transition: all var(--transition-base);
  border-radius: 0;
  position: relative;
}

.sidebar-submenu li a::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: transparent;
  border-radius: 50%;
}

.sidebar-submenu li a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding-left: 2.25rem;
  border-radius: var(--radius-md);
}

.sidebar-submenu li a:hover::before {
  background: #ffffff;

}

.sidebar-submenu li a.active {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 500;
}

.sidebar-submenu li a.active::before {
  background: #ffffff;
}

.sidebar-submenu li {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.sidebar-submenu li a i {
  width: 16px;
  font-size: 0.875rem;
}

/* Sidebar Section Styles */
.sidebar-section {
  margin-bottom: 0.5rem;
}

.sidebar-section-title {
  display: block;
  padding: 0.875rem 1.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  margin: 0;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.75rem 1.25rem;
  margin: 0.125rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition-base);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.sidebar-menu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: transparent;
  transition: background var(--transition-base);
}

.sidebar-menu a span {
  flex: 1;
  transition: transform var(--transition-fast);
}

.sidebar-menu a i {
  width: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.sidebar-menu a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(4px);
}

.sidebar-menu a:hover::before {
  background: #ffffff;
}

.sidebar-menu a:hover i {
  color: #ffffff;
  transform: scale(1.1);
}

.sidebar-menu a:hover span {
  transform: translateX(2px);
}

.sidebar-menu a.active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.sidebar-menu a.active::before {
  background: var(--accent);
}

.sidebar-menu a.active i {
  color: var(--accent);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: #fbfdff;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0rem 0.50rem;
  text-decoration: none;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: transparent;
}

.sidebar-logout:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.sidebar-logout i {
  font-size: 1rem;
}

/* Main Content Area */
.app-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: 100%;
  background: var(--bg);
}

.page-content {
  max-width: 1400px;
  margin: 0 auto;
}

/* Footer Styles */
.app-footer {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Alert Styles - Enhanced */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-sm);
  animation: slideInDown 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
}

.alert i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert p {
  font-size: 0.9375rem;
}

.alert-success {
  background: var(--success-light);
  color: #166534;
  border-color: #bbf7d0;
}

.alert-success::before {
  background: var(--success);
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
  border-color: #fecaca;
}

.alert-danger::before {
  background: var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
  border-color: #fdba74;
}

.alert-warning::before {
  background: var(--warning);
}

.alert-info {
  background: var(--info-light);
  color: #075985;
  border-color: #bae6fd;
}

.alert-info::before {
  background: var(--info);
}

/* Info Panel - For static information display (not auto-hiding alerts) */
.info-panel {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--info-light);
  color: #075985;
  margin-bottom: 1rem;
  position: relative;
}

.info-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--info);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* File Panel - For file information display */
.file-panel {
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  position: relative;
}

.file-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-muted);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* Table Styles - Enhanced */
.table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.table-actions.single-button {
  justify-content: center !important;
}

/* Pagination styles (CodeIgniter default pager) */
.pagination {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.pagination li a:hover {
  background: #f3f4f6;
}

.pagination li.active a,
.pagination li.active span {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination li.disabled span {
  opacity: 0.6;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  min-width: 600px;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  background-color: #fbfdff;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}

.table td {
  color: var(--text-primary);
  font-weight: 400;
}

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

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Action Buttons in Table */
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.table-actions.only-one {
  justify-content: center !important;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  text-decoration: none;
  background: transparent;
}

.btn-icon-primary {
  background: #dbeafe;
  color: #1e40af;
}

.btn-icon-success {
  background: #dcfce7;
  color: #166534;
}

.btn-icon-primary:hover {
  background: #bfdbfe;
  color: #1e3a8a;
}

.btn-icon-danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn-icon-info {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-icon-warning {
  background: #fed7aa;
  color: #9a3412;
}

.btn-icon-danger:hover {
  background: #fecaca;
  color: #7f1d1d;
}

/* Mobile Responsive - Convert Table to List */
@media (max-width: 768px) {
  .table {
    min-width: auto;
    border: none;
    box-shadow: none;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .table tbody tr {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: none;
  }

  .table tbody tr:hover {
    background-color: #fbfdff;
    box-shadow: 0 2px 8px rgba(27, 58, 138, 0.1);
  }

  .table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .table tbody tr td:last-child {
    border-bottom: none;
  }

  .table tbody tr td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
  }

  .table-actions {
    margin-top: 0.75rem;
    justify-content: flex-start;
  }
}

/* Button Styles - Enhanced */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  transition: all var(--transition-base);
  font-size: 0.9375rem;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width var(--transition-slow), height var(--transition-slow);
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
  display: flex;
  text-align: center;
}

/* Form Styles - Enhanced */
.form-login {
  width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-label i {
  color: var(--accent);
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
}

.info-value {
  font-weight: 400;
  font-size: 0.9rem;
}

/* Form Grid for multiple columns */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Input with icon */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 1;
}

.input-with-icon .form-control {
  padding-right: 3rem;
}

.toggle-password {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
  border-radius: 6px;
  width: 36px;
  height: 36px;
}

.toggle-password:hover {
  color: var(--accent);
  background: #f3f4f6;
}

.toggle-password:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-password i {
  font-size: 1rem;
}

.position-relative {
  position: relative;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Inter', ui-sans-serif;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: #fff;
  color: var(--text-primary);
}

.form-control:hover {
  border-color: #9ca3af;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
  color: #9ca3af;
}

/* Select dropdown styling */
.form-select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  appearance: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:hover {
  border-color: var(--accent);
}

.form-select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select option {
  padding: 0.5rem;
  background-color: var(--bg);
  color: var(--text-primary);
}

/* Range Input Styling */
input[type="range"].form-control {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #d1d5db;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
}

input[type="range"].form-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"].form-control::-webkit-slider-thumb:hover {
  background: var(--accent-hover, #2563eb);
}

input[type="range"].form-control::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"].form-control::-moz-range-thumb:hover {
  background: var(--accent-hover, #2563eb);
}

.form-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Filter Section Styling */
.filter-section {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.filter-section .filter-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-section .filter-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  white-space: nowrap;
}

.filter-section .form-select {
  min-width: 200px;
  max-width: 250px;
}

/* Responsive filter */
@media (max-width: 768px) {
  .filter-section .filter-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filter-section .filter-label {
    text-align: left;
    margin-bottom: 0.25rem;
  }

  .filter-section .form-select {
    min-width: 100%;
    max-width: none;
  }
}

.form-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.form-footer i {
  color: var(--success);
}

/* Form Card & Actions */
.form-card {
  width: 100%;
  max-width: 100%;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.form-actions .btn {
  flex: 1;
  min-width: 150px;
}

.btn-secondary {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #d1d5db;
}

/* Outline Button Variants */
.btn-outline-primary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.btn-outline-primary:hover:not(:disabled) {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.btn-outline-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-success {
  background: transparent;
  color: var(--success);
  border: 1px solid var(--success);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.btn-outline-success:hover:not(:disabled) {
  background: var(--success);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.btn-outline-danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-outline-warning {
  background: transparent;
  color: var(--warning);
  border: 1px solid var(--warning);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.btn-outline-warning:hover:not(:disabled) {
  background: var(--warning);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Responsive Form */
@media (max-width: 768px) {
  .form-actions .btn {
    flex: 1 0 calc(50% - 0.5rem);
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    flex: 1 0 auto;
    width: 100%;
  }
}

.text-center {
  text-align: center;
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Auth Styles - Enhanced */
.auth-body {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  min-height: 100vh;
}

.auth-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-container {
  width: 100%;
  max-width: 460px;
}

.auth-card.card {
  width: 100%;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(27, 58, 138, 0.15);
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card .card-header {
  padding: 2.5rem 2rem 1.5rem 2rem;
  text-align: center;
  background: linear-gradient(to bottom, #fbfdff, #fff);
  border-bottom: 1px solid var(--border-color);
}

.auth-card .logo-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 32px;
  margin: 0 auto 1rem;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transition: transform 0.3s ease;
}

.auth-card .logo-circle:hover {
  transform: scale(1.05);
}

.auth-card .card-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  letter-spacing: -0.8px;
}

.auth-card .card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.auth-card .card-content {
  padding: 2rem;
}

/* Dashboard and Card Styles */
.space-y-6>*+* {
  margin-top: 1.5rem;
}

.space-y-4>*+* {
  margin-top: 1rem;
}

.space-y-2>*+* {
  margin-top: 0.5rem;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(27, 58, 138, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(27, 58, 138, 0.12);
  transform: translateY(-2px);
}

.card-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.card-content {
  padding: 1.25rem;
}

.card .card-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card .card-content>div:first-child {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-top: 0.5rem;
}

.username {
  margin-left: 0.5rem;
  color: var(--text-secondary);
}

.logout {
  margin-left: 0.75rem;
  color: var(--danger);
  text-decoration: none;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  padding: 1rem;
}

.modal {
  background: var(--card-bg);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background-color: #fbfdff;
  flex-wrap: wrap;
}

.modal.hidden {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

/* Do not hide horizontal scroll globally on desktop to avoid clipping large tables */
html,
body {
  width: 100%;
}

/* Responsive Design */
@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {

  /* Show desktop sidebar toggle for laptops */
  .sidebar-toggle-desktop {
    display: block;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Laptop 12-14 inch - Desktop mode dengan sidebar normal */
@media (min-width: 1101px) and (max-width: 1400px) {
  .app-sidebar {
    width: 260px;
    /* Sidebar sedikit lebih kecil untuk laptop 12-14 inch */
  }

  .app-sidebar.collapsed {
    width: 55px;
  }

  .app-main {
    padding: 1.75rem;
  }

  .app-content.sidebar-collapsed {
    margin-left: 55px;
  }
}

/* Mobile Responsive - Tablets and small laptops */
@media (max-width: 1100px) {
  .app-header {
    padding: 1rem;
  }

  .brand-link {
    font-size: 1.1rem;
  }

  .topnav {
    gap: 1rem;
  }

  .app-main {
    padding: 1.5rem;
  }

  /* Force mobile sidebar behavior on small laptops */
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 69px;
    height: calc(100vh - 69px);
    z-index: 99;
    transform: translateX(-100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    width: 280px;
  }

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

  .app-sidebar.collapsed {
    width: 280px;
    transform: translateX(-100%);
  }

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

  .app-content.sidebar-collapsed {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .sidebar-toggle-desktop {
    display: none;
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
    position: fixed;
    top: 69px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
  }
}



@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .sidebar-toggle-desktop {
    display: none;
  }

  .app-sidebar {
    word-break: break-word;
    position: fixed;
    left: 0;
    top: 69px;
    height: calc(100vh - 69px);
    z-index: 99;
    transform: translateX(-100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    justify-content: flex-start;
    width: 100%;
  }

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

  /* Reset collapsed state on mobile */
  .app-sidebar.collapsed {
    width: 100%;
    transform: translateX(-100%);
  }

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

  .app-content.sidebar-collapsed {
    margin-left: 0;
  }

  .topnav {
    gap: 0.5rem;
  }

  .topnav a {
    font-size: 0.85rem;
  }

  .topnav .role {
    display: none;
  }

  .app-main {
    padding: 1rem;
  }

  /* Responsive Header - Stack on mobile */
  .flex.items-center.justify-between {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .flex.items-center.justify-between>div:first-child {
    flex: 1 0 100%;
  }

  .flex.items-center.justify-between>a {
    flex: 1;
    text-align: center;
  }

  .auth-root {
    padding: 1rem;
    min-height: calc(100vh - 60px);
  }

  .auth-card.card {
    max-width: 100%;
  }

  .card-header {
    padding: 1.5rem 1rem 0.75rem 1rem;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .logo-circle {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }

  .card-content {
    padding: 1rem;
  }

  .modal {
    max-width: 100%;
    margin: 1rem;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.75rem;
  }

  .grid {
    gap: 1rem;
  }

  .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  .form-group label {
    font-size: 0.85rem;
  }

  body.sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0.75rem;
  }

  .brand-link {
    font-size: 1rem;
  }

  .brand-link:before {
    font-size: 1.25rem;
  }

  .topnav {
    gap: 0.25rem;
  }

  .username {
    display: none;
  }

  .auth-card .card-title {
    font-size: 1.5rem;
  }

  .auth-card .card-description {
    font-size: 0.85rem;
  }

  .auth-card .card-header {
    padding: 2rem 1.5rem 1.25rem;
  }

  .auth-card .card-content {
    padding: 1.5rem;
  }

  .auth-card .logo-circle {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }

  .auth-root {
    padding: 1rem;
  }

  .form-control {
    font-size: 16px;
    /* Prevent zoom on iOS */
    padding: 0.75rem 1rem;
  }

  .btn {
    padding: 0.75rem 1rem;
  }
}

/* Utility Classes */
.d-none {
  display: none;
}

.d-block {
  display: block;
}

.d-flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.p-1 {
  padding: 0.5rem;
}

.p-2 {
  padding: 1rem;
}

.p-3 {
  padding: 1.5rem;
}

.p-4 {
  padding: 2rem;
}

.p-6 {
  padding: 1.5rem;
}

.bg-gradient-to-r {
  background: linear-gradient(to right, var(--value1), var(--value2));
}

.from-blue-50 {
  --value1: #f0f9ff;
}

.to-blue-100 {
  --value2: #e0f2fe;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1rem;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-primary {
  color: var(--accent);
}

.text-danger {
  color: var(--danger);
}

.rounded {
  border-radius: 6px;
}

.rounded-lg {
  border-radius: 8px;
}

.border-2 {
  border-width: 2px;
}

.font-bold {
  font-weight: 700;
}

/* Display utilities to replace Tailwind-like classes used in views */
.display-lg {
  font-size: 1.5rem;
  /* approx text-2xl */
  font-weight: 700;
  color: var(--accent);
}

.display-xl {
  font-size: 1.75rem;
  /* approx text-3xl */
  font-weight: 700;
  color: var(--accent);
}

.my-6 {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.my-8 {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.gap-6 {
  gap: 1.5rem;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Overlay for mobile menu */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 69px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 98;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
}

/* Ensure overlay works properly on small laptops */
@media (max-width: 1100px) {
  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  body.sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 768px) {

  /* Prevent horizontal scroll on mobile */
  html,
  body,
  .app-main,
  .page-content,
  .space-y-6 {
    overflow-x: hidden !important;
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Auth pages responsive */
  .auth-root {
    padding: 1.25rem;
  }

  .auth-card .card-header {
    padding: 2rem 1.75rem 1.25rem;
  }

  .auth-card .card-content {
    padding: 1.75rem;
  }

  .auth-card .logo-circle {
    width: 75px;
    height: 75px;
    font-size: 30px;
  }

  .auth-card .card-title {
    font-size: 1.6rem;
  }

  .auth-footer {
    font-size: 0.8rem;
    padding: 0.75rem;
  }
}

/* Account Page Styles */
.account-wrapper {
  width: 100%;
  max-width: none;
  margin: 0;
}

.account-header-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.account-details-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.account-details-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  position: relative;
}

.account-details-item+.account-details-item {
  border-top: 1px solid var(--border-color);
}

.account-details-item i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(27, 58, 138, .12);
}

.account-details-label {
  font-size: .65rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: .5px;
  font-weight: 600;
}

.account-details-value {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: .35rem;
  word-break: break-word;
}

.account-details-item:hover {
  background: linear-gradient(to right, #f8fbff, #edf5ff);
}

.divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 1.25rem 0;
}

.actions-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.account-section {
  margin-top: 1.5rem;
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}

.account-section.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Role badge styling */
.role-badge {
  background: #e0e7ff;
  color: #1e3a8a;
  padding: 0.4rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: .5px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid #c7d2fe;
  box-shadow: 0 2px 4px rgba(30, 64, 175, .15);
  text-transform: uppercase;
}

/* Utility for subtle hint text */
.text-hint {
  color: var(--text-secondary);
  font-size: .75rem;
}

/* Page title enhancements */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: .9rem;
  color: var(--text-secondary);
  margin: .25rem 0 0;
}

/* Display inline utility */
.d-inline {
  display: inline;
}

/* KM Detail Page Styles */
.km-total-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
  margin-top: 0.5rem;
}

.km-total-row {
  background: #f0f9ff;
  font-weight: 600;
}

.km-netto-row {
  background: #dcfce7;
  font-weight: 700;
}

.km-payment-info {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.km-payment-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.km-payment-row span {
  color: var(--text-secondary);
}

/* Badge variants */
.badge-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-info {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.km-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .65rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .3px;
  border: 1px solid transparent;
}

.km-status-approved {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.km-status-rejected {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.km-status-pending {
  background: #e5e7eb;
  color: #6b7280;
  border-color: #d1d5db;
}

.km-status-badge i {
  font-size: .75rem;
}

/* Condensed spacing & typography helpers for KM detail */
.space-y-tight>*+* {
  margin-top: 0.6rem;
}

.km-title-info {
  font-weight: 500;
  font-size: .9rem;
  margin: 0 0 .4rem;
  color: var(--text-primary);
  letter-spacing: .2px;
}

.km-title-sm {
  font-weight: 600;
  font-size: .9rem;
  margin: 0 0 .4rem;
  color: var(--text-primary);
  letter-spacing: .25px;
}

.km-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: .6rem 0 .5rem;
}

.km-grid {
  display: grid;
  gap: .6rem;
}

.km-grid.md-2 {
  grid-template-columns: 1fr;
}

.km-grid.md-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .km-grid.md-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .km-grid.md-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Slightly tighter label bottom margin for compact sections */
.km-grid label.mb-1 {
  margin-bottom: .35rem;
}

@media (max-width: 768px) {
  .km-detail-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .km-total-amount {
    font-size: 1.25rem;
  }

  .km-detail-qty {
    font-size: 1.1rem;
  }
}

/* Table alignment utilities */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

/* Tab Navigation Styles */
.nav-tabs {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
}

.nav-tabs::-webkit-scrollbar {
  height: 4px;
}

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

.nav-tabs::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.nav-item {
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
  transition: all var(--transition-base);
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--accent-lighter);
  border-color: var(--accent-light);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--accent);
  background: var(--card-bg);
  border-color: var(--border-color) var(--border-color) var(--card-bg);
  border-bottom: 1px solid var(--card-bg);
  font-weight: 600;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: -1px;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.nav-separator {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  padding: 0 0.5rem;
  font-size: 1.125rem;
}

@media (max-width: 768px) {
  .nav-tabs {
    gap: 0.25rem;
    padding: 0 0.5rem;
  }

  .nav-link {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  .nav-separator {
    padding: 0 0.25rem;
    font-size: 1rem;
  }
}

/* Responsive Utilities - Mobile & Tablet */
@media (max-width: 768px) {

  /* Prevent horizontal scroll */
  body,
  .app-main,
  .page-content,
  .space-y-6 {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Ensure all child elements respect container width */
  .space-y-6>* {
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Page headers with buttons - stack vertically */
  .space-y-6>.flex.items-center.justify-between,
  .flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem;
  }

  .space-y-6>.flex.items-center.justify-between>div:first-child,
  .flex.items-center.justify-between>div:first-child {
    width: 100%;
  }

  .d-flex.gap-1 {
    flex-direction: column;
    gap: 0.5rem !important;
    width: 100%;
  }

  .d-flex.gap-1 .btn {
    width: 100%;
    justify-content: center;
  }

  /* Summary cards - single column */
  .grid.md\:grid-cols-2,
  .grid.grid-cols-2,
  .grid.md\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* Card elements should fit within container */
  .card,
  .card-content,
  .card-header {
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* All inline flex containers */
  .card-content>div[style*="display: flex"],
  .card-content>div>div[style*="display: flex"],
  div[style*="display: flex; align-items: flex-start"] {
    flex-wrap: wrap !important;
    overflow: hidden;
  }

  /* Flex items inside cards */
  div[style*="flex: 1; min-width: 250px"] {
    min-width: 100% !important;
    flex: 1 1 100% !important;
  }

  div[style*="flex: 1"] {
    min-width: 0 !important;
  }

  /* Badge containers */
  div[style*="display: flex; align-items: center; gap"] {
    flex-wrap: wrap !important;
  }

  /* Icon + text containers */
  div[style*="display: flex; flex-wrap: wrap; gap"] {
    gap: 0.75rem !important;
  }

  /* Summary card icon containers */
  div[style*="width: 48px; height: 48px"] {
    flex-shrink: 0;
  }

  /* Card titles and descriptions */
  .card-title {
    font-size: 1.15rem;
  }

  .card-description {
    font-size: 0.8rem;
  }

  .page-title {
    font-size: 1.4rem;
  }

  /* Display text in cards */
  .display-lg {
    font-size: 1.15rem !important;
    word-wrap: break-word;
  }

  .display-xl {
    font-size: 1.35rem;
  }

  /* Space utilities - reduce spacing */
  .space-y-6 {
    gap: 1rem;
  }

  .space-y-6>*+* {
    margin-top: 1rem;
  }

  /* Ensure buttons don't cause overflow */
  .btn,
  .btn-icon {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Badge responsive */
  .badge {
    font-size: 0.7rem !important;
    padding: 0.3rem 0.5rem !important;
    white-space: nowrap;
  }

  /* Table container */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Grid columns full width on KM mode */
  div[style*="grid-column: span 2"] {
    grid-column: 1 !important;
  }

  /* Remove mb-4 class margins in space-y-6 context */
  .space-y-6 .mb-4,
  .space-y-6>.mb-4 {
    margin-bottom: 0 !important;
  }

  /* Ensure grid with gap doesn't overflow */
  .grid.gap-6,
  .grid[class*="gap-"] {
    gap: 1rem !important;
  }

  /* Inline style overrides for mobile */
  .card-content div[style] {
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {

  /* Further reductions for very small screens */
  .page-title {
    font-size: 1.25rem;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-description {
    font-size: 0.75rem;
  }

  .display-lg {
    font-size: 1rem !important;
  }

  .display-xl {
    font-size: 1.15rem;
  }

  /* Buttons smaller */
  .btn {
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
  }

  .btn-sm {
    font-size: 0.75rem;
    padding: 0.45rem 0.7rem;
  }

  /* Card content padding */
  .card-content {
    padding: 1rem;
  }

  .card-header {
    padding: 1rem;
  }

  /* Space utilities - even more compact */
  .space-y-6>*+* {
    margin-top: 0.75rem;
  }

  /* Reduce gaps in flex containers */
  div[style*="gap: 1.5rem"] {
    gap: 0.5rem !important;
  }

  div[style*="gap: 1rem"] {
    gap: 0.5rem !important;
  }

  /* Badge even smaller */
  .badge {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.4rem !important;
  }

  /* Icon containers smaller */
  div[style*="width: 48px; height: 48px"] {
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
  }
}

/* Force center alignment for action headers */
.table th.text-center[style*='text-align: center'] {
  text-align: center !important;
}

/* Laporan Page Styles - Reusable Components */
.laporan-container {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.laporan-container .card-content {
  padding: 0;
}

.laporan-tabs {
  padding: 1.5rem 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.laporan-tabs .nav-tabs {
  margin-bottom: 0;
  border-bottom: none;
}

.laporan-filter {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.laporan-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.laporan-filter-grid .form-group {
  flex: 1;
  min-width: 180px;
  margin-bottom: 0;
}

.laporan-filter-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .laporan-filter-grid {
    flex-direction: column;
  }

  .laporan-filter-grid .form-group {
    width: 100%;
    min-width: 100%;
  }

  .laporan-filter-actions {
    width: 100%;
    justify-content: stretch;
  }

  .laporan-filter-actions .btn {
    flex: 1;
  }
}

.laporan-content {
  padding: 1.5rem;
}

.laporan-summary-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.laporan-summary-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.laporan-summary-grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (min-width: 768px) {
  .laporan-summary-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .laporan-summary-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.laporan-summary-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.laporan-summary-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.laporan-summary-card .card-content {
  padding: 1.25rem;
}

.laporan-summary-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.laporan-summary-value {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.laporan-summary-value.primary {
  color: var(--accent);
}

.laporan-summary-value.success {
  color: var(--success);
}

.laporan-summary-value.warning {
  color: var(--warning);
}

.laporan-table-wrapper {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.laporan-empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 3rem 2rem;
  font-size: 0.9375rem;
}

.laporan-tab-content {
  display: none;
}

.laporan-tab-content.active {
  display: block;
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .laporan-container {
    margin: 0 -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .laporan-tabs {
    padding: 1rem;
  }

  .laporan-filter {
    padding: 1rem;
  }

  .laporan-content {
    padding: 1rem;
  }

  .laporan-summary-grid {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .laporan-summary-card .card-content {
    padding: 1rem;
  }

  .laporan-summary-value {
    font-size: 1.125rem;
  }

  .laporan-table-wrapper {
    padding: 1rem;
    margin: 0 -0.5rem;
  }
}
