@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary-navy: #0f172a;
  --secondary-navy: #1e293b;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: #eff6ff;
  --accent-blue-border: #bfdbfe;
  
  --success-green: #059669;
  --success-green-light: #ecfdf5;
  --success-green-border: #a7f3d0;
  
  --warning-amber: #d97706;
  --warning-amber-light: #fffbeb;
  --warning-amber-border: #fde68a;
  
  --danger-red: #dc2626;
  --danger-red-light: #fef2f2;
  --danger-red-border: #fecaca;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-input-focus: #ffffff;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* App Header */
.app-header {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  color: #ffffff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-badge {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.app-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.app-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

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

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, var(--success-green) 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

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

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, var(--danger-red) 100%);
  color: #ffffff;
}

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

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

/* Tabs System */
.tabs-bar {
  background: var(--secondary-navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  padding: 0 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}

.tab-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.tab-btn.active .tab-badge {
  background: #2563eb;
  color: #ffffff;
}

/* Main Container */
.main-content {
  padding: 24px 28px;
  max-width: 1360px;
  margin: 0 auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Notification & Alert Banners */
.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-amber {
  background: var(--warning-amber-light);
  border: 1px solid var(--warning-amber-border);
  color: #92400e;
}

.alert-blue {
  background: var(--accent-blue-light);
  border: 1px solid var(--accent-blue-border);
  color: #1e40af;
}

/* Section Cards */
.card-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card-section:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--primary-navy);
}

.card-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-body {
  padding: 20px;
}

/* Grid Layouts */
.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label .req {
  color: var(--danger-red);
  margin-left: 2px;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: var(--font-sans);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 12.5px;
  background: var(--bg-input);
  color: var(--text-main);
  transition: all 0.15s ease;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: var(--bg-input-focus);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12);
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  appearance: none;
}

.readonly-display {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 12.5px;
  color: var(--text-main);
  font-weight: 600;
}

.readonly-computed {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue-border);
  color: #1e3a8a;
  font-weight: 700;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  background: #f8fafc;
  color: var(--primary-navy);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 11.5px;
  border-bottom: 1.5px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

tr:nth-child(even) td {
  background: #fafcfd;
}

tr:hover td {
  background: #f1f5f9;
}

td input,
td select {
  padding: 5px 8px;
  font-size: 12px;
}

/* Divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 18px 0;
}

/* KPI Output Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-blue);
}

.kpi-card.highlight::before {
  background: var(--success-green);
}

.kpi-card.highlight {
  background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-navy);
}

.kpi-unit {
  font-size: 10.5px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Final Result Hero Card */
.decision-hero {
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  border: 2px solid transparent;
  box-shadow: var(--shadow-md);
}

.decision-hero.approve {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

.decision-hero.rework {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
}

.decision-hero.reject {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fca5a5;
}

.decision-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.decision-badge {
  font-size: 34px;
  font-weight: 900;
  margin: 6px 0;
  letter-spacing: -0.5px;
}

.decision-hero.approve .decision-badge {
  color: #15803d;
}

.decision-hero.rework .decision-badge {
  color: #b45309;
}

.decision-hero.reject .decision-badge {
  color: #b91c1c;
}

.decision-metrics {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.decision-metrics strong {
  color: var(--primary-navy);
  font-family: var(--font-mono);
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.badge-approve {
  background: #dcfce7;
  color: #166534;
}

.badge-rework {
  background: #fef3c7;
  color: #92400e;
}

.badge-reject {
  background: #fee2e2;
  color: #991b1b;
}

/* Row Letters */
.row-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success {
  background: #059669;
}

.toast-error {
  background: #dc2626;
}

.toast-info {
  background: #2563eb;
}

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

/* Login Screen Overlay & Card */
.auth-wrapper {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(16px);
}

.auth-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  color: #ffffff;
  backdrop-filter: blur(20px);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.auth-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .form-label {
  color: #cbd5e1;
  font-size: 11.5px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: var(--radius-md);
}

.auth-form input:focus {
  border-color: #60a5fa;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

.auth-btn-submit {
  width: 100%;
  padding: 11px;
  font-size: 13.5px;
  margin-top: 6px;
}

.demo-login-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-align: center;
}

.demo-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-demo {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.btn-demo:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: #60a5fa;
  color: #ffffff;
}

.btn-demo span:last-child {
  font-size: 10px;
  color: #94a3b8;
}

/* User Header Chip */
/* Redesigned Modern Dashboard Header */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Global Search Bar */
.header-search-container {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.header-search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  transition: all 0.2s ease;
  position: relative;
}

.header-search-box:focus-within {
  background: rgba(255, 255, 255, 0.15);
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.header-search-icon {
  font-size: 14px;
  color: #94a3b8;
  margin-right: 8px;
}

.header-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  width: 100%;
}

.header-search-input::placeholder {
  color: #94a3b8;
}

.header-search-kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #94a3b8;
  font-size: 10.5px;
  padding: 1px 6px;
  font-family: inherit;
  font-weight: 600;
  pointer-events: none;
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  color: var(--text-main);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  max-height: 420px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
  animation: modalSlideUp 0.18s ease;
}

.global-search-dropdown.show {
  display: block;
}

.search-result-group-title {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: #f1f5f9;
}

/* Header Right Dashboard Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Dropdown Container */
.header-dropdown-wrapper {
  position: relative;
}

/* Action Menu Button (Dropdown Trigger) */
.header-action-menu-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-action-menu-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Notifications Button */
.header-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  font-size: 15px;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Notification Badge */
.header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #0f172a;
}

/* Dropdown Menus */
.dashboard-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  color: var(--text-main);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  min-width: 250px;
  z-index: 10000;
  display: none;
  animation: modalSlideUp 0.18s ease;
  overflow: hidden;
}

.dashboard-dropdown-menu.show {
  display: block;
}

.dropdown-header-box {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.dropdown-menu-list {
  padding: 6px 0;
}

.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font-weight: 500;
}

.dropdown-menu-item:hover {
  background: #f1f5f9;
  color: #1e40af;
}

.dropdown-menu-item.danger {
  color: #ef4444;
}

.dropdown-menu-item.danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* User Profile Trigger */
.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.user-role {
  font-size: 9.5px;
  color: #94a3b8;
  line-height: 1.1;
}

.notification-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: background 0.15s ease;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-item.unread {
  background: #eff6ff;
}

.notification-icon {
  font-size: 16px;
  margin-top: 1px;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}

.notification-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.35;
}

.notification-time {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  .header-search-container {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .main-content {
    padding: 16px;
  }
}

/* CFA Custom Modern Tooltips */
.cfa-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: help;
}

.cfa-tooltip .cfa-info-icon {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.65;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.cfa-tooltip:hover .cfa-info-icon {
  opacity: 1;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
  transform: scale(1.1);
}

.cfa-tooltip-box {
  visibility: hidden;
  opacity: 0;
  width: 260px;
  background: #0f172a;
  color: #f8fafc;
  text-align: left;
  border-radius: 6px;
  padding: 10px 12px;
  position: absolute;
  z-index: 1000;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  white-space: normal;
}

.cfa-tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.cfa-tooltip:hover .cfa-tooltip-box {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modal Windows & Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  padding: 18px 24px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
}
.modal-close-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--danger-red);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* User & Admin Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.role-badge.admin {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.role-badge.officer {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.role-badge.manager {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.user-attribution-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #475569;
  font-weight: 600;
}

/* ========================================================================= */
/* Admin User-Wise Data Entries & Section-Wise Inspection Styles            */
/* ========================================================================= */

.admin-entries-container {
  margin-top: 24px;
}

.admin-user-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.admin-user-select-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-user-select-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-select-dropdown {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent-blue);
  background-color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  min-width: 260px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.admin-user-select-dropdown:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff;
}

/* View Mode Segmented Control */
.admin-view-toggle {
  display: inline-flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 4px;
}

.admin-toggle-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.admin-toggle-btn:hover {
  color: var(--text-main);
}

.admin-toggle-btn.active {
  background: #ffffff;
  color: var(--accent-blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

/* Filter Toolbar */
.admin-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.admin-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-search-input {
  min-width: 220px;
  padding: 7px 12px;
  font-size: 12.5px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
}

.admin-filter-select {
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  font-weight: 500;
}

/* Section-Wise Card Presentation */
.sheet-section-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.sheet-section-card:hover {
  box-shadow: var(--shadow-md);
}

.sheet-section-header {
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.sheet-section-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.sheet-header-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sheet-header-badge.sheet2 {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.sheet-header-badge.sheet3 {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.sheet-header-badge.sheet-output {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.sheet-section-body {
  padding: 20px;
}

.form-grid-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px 20px;
}

.form-field-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-field-val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  min-height: 32px;
  display: flex;
  align-items: center;
  word-break: break-word;
}

.form-field-val.highlight {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
  font-weight: 700;
}

.form-field-val.badge-val {
  display: inline-flex;
  padding: 4px 10px;
  font-weight: 700;
  border-radius: 4px;
  width: fit-content;
}

/* Sub-section dividing banner */
.sheet-sub-header {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin: 18px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}




