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

:root {
  --primary: #0F172A;
  --secondary: #2563EB;
  --secondary-light: #EFF6FF;
  --secondary-hover: #1D4ED8;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --pending: #F59E0B;
  --pending-light: #FEF3C7;
  --bg-grey: #F8FAFC;
  --card-white: #FFFFFF;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --border-focus: #93C5FD;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
  --transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-grey);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--primary);
}

/* ==========================================================================
   Utility Classes & Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  gap: 0.5rem;
}

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

.btn-primary {
  background-color: var(--secondary);
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
  background-color: var(--secondary-hover);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3), 0 4px 6px rgba(37, 99, 235, 0.15);
  transform: translateY(-3px) scale(1.03);
}

.btn-secondary {
  background-color: white;
  border-color: var(--border-light);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background-color: var(--bg-grey);
  border-color: var(--text-muted);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 15px rgba(15, 23, 42, 0.08);
}

.btn-danger {
  background-color: #EF4444;
  color: white;
}

.btn-danger:hover {
  background-color: #DC2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pending {
  background-color: var(--pending-light);
  color: #B45309;
}

.badge-progress {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.badge-success {
  background-color: var(--success-light);
  color: var(--success);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}

.form-control,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--card-white);
  color: var(--text-dark);
  transition: var(--transition);
}

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

/* Card base */
.card {
  background-color: var(--card-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  position: relative;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px) scale(1.01) translateZ(0);
  box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.12), 0 10px 20px -10px rgba(15, 23, 42, 0.08);
  border-color: var(--secondary);
}

/* Blur & overlay for completed cards */
.completed-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.card.is-completed .completed-overlay {
  opacity: 1;
  pointer-events: auto;
}

.card.is-completed .card-content-blur {
  filter: blur(1.5px);
  pointer-events: none;
  user-select: none;
}

.card.is-completed.temp-unblurred .completed-overlay {
  opacity: 0;
  pointer-events: none;
}

.card.is-completed.temp-unblurred .card-content-blur {
  filter: none;
  pointer-events: auto;
  user-select: auto;
}

.unblur-banner {
  display: none;
  background-color: var(--success-light);
  color: var(--success);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.card.is-completed.temp-unblurred .unblur-banner {
  display: flex;
}

.overlay-badge {
  background-color: var(--success);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
}

/* Progress indicator circle */
.progress-circle {
  position: relative;
  width: 70px;
  height: 70px;
}

.progress-circle svg {
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
}

.progress-circle circle {
  fill: none;
  stroke-width: 6;
}

.progress-circle .bg {
  stroke: var(--border-light);
}

.progress-circle .progress-bar {
  stroke: var(--secondary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s;
}

.progress-circle .progress-bar.complete {
  stroke: var(--success);
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-display);
}

/* Horizontal Progress bar */
.progress-track-wrapper {
  margin-top: 0.5rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--secondary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-fill.success {
  background-color: var(--success);
}

/* ==========================================================================
   Login Flow
   ========================================================================== */
.login-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-grey);
}

.login-left {
  flex: 1;
  background: linear-gradient(135deg, var(--primary) 0%, #1E293B 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 4rem;
  color: white;
}

.login-left h1 {
  color: white;
  font-size: 3.5rem;
  line-height: 1.1;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.login-left p {
  font-size: 1.15rem;
  color: #94A3B8;
  max-width: 480px;
  line-height: 1.6;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background-color: var(--secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: white;
  font-weight: bold;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: white;
}

.login-right {
  width: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--bg-grey);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--card-white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.login-card h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.login-card p.subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ==========================================================================
   Dashboard Layout
   ========================================================================== */
.app-layout {
  display: none;
  /* Shown after login */
  grid-template-columns: 260px 1fr;
  grid-template-rows: 70px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}

/* Header */
.app-header {
  grid-area: header;
  background-color: var(--card-white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  max-width: 600px;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border-light);
  background-color: var(--bg-grey);
  font-size: 0.9rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  background-color: white;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.notification-bell {
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-dark);
  font-size: 1.35rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bell:hover {
  background-color: var(--bg-grey);
}

.notification-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: #EF4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  height: 16px;
  min-width: 16px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--card-white);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background-color: var(--secondary-light);
  color: var(--secondary);
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

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

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  line-height: 1.2;
}

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

/* Sidebar */
.app-sidebar {
  grid-area: sidebar;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  color: white;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-menu {
  list-style: none;
  padding: 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-menu-item > a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: #94A3B8;
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sidebar-menu-item > a:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: white;
  padding-left: 1.25rem;
}

.sidebar-menu-item.active > a {
  background: linear-gradient(135deg, var(--secondary) 0%, #3b82f6 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-2px) scale(1.02) translateZ(0);
}

.sidebar-submenu {
  list-style: none;
  padding-left: 1.5rem;
  margin-top: 0.25rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-submenu li a {
  padding: 0.45rem 0.75rem !important;
  font-size: 0.85rem !important;
  color: #94A3B8 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  border-radius: var(--radius-sm) !important;
  text-decoration: none !important;
  background: none !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: 500 !important;
  transition: all 0.3s !important;
}

.sidebar-submenu li a:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: white !important;
  padding-left: 1rem !important;
}

.sidebar-submenu li.active a {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #F8FAFC;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-logout:hover {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: #EF4444;
  color: #FEE2E2;
}

/* Main Area */
.app-main {
  grid-area: main;
  padding: 2rem;
  overflow-y: auto;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* View switching system */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.view-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-title h2 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.view-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   Dashboard Home View
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--card-white);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02) translateZ(0);
  box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.15), 0 10px 20px -10px rgba(15, 23, 42, 0.08);
  border-color: var(--secondary);
}

.stat-card-left {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-val {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-display);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.blue {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.stat-icon.orange {
  background-color: var(--pending-light);
  color: var(--pending);
}

.stat-icon.green {
  background-color: var(--success-light);
  color: var(--success);
}

/* Inquiry Cards Grid */
.inquiry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.inquiry-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.inquiry-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
}

.inquiry-id {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary);
  background-color: var(--secondary-light);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.inquiry-location {
  font-weight: 600;
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

.inquiry-dept {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.inquiry-progress-item {
  margin-bottom: 0.75rem;
}

.progress-label-val {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.inquiry-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
  margin-top: auto;
}

.overall-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.overall-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   Section 1: New Inquiry Form
   ========================================================================== */
.form-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border-light);
}

.dropdown-action-wrapper {
  display: flex;
  gap: 0.5rem;
}

.btn-icon-only {
  padding: 0 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-icon-only:hover {
  background-color: var(--bg-grey);
  border-color: var(--secondary);
  color: var(--secondary);
}

/* Products Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.table-products {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-products th {
  background-color: var(--bg-grey);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.table-products td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  background-color: white;
  vertical-align: middle;
}

.table-products input,
.table-products select {
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
}

.grand-total-row {
  background-color: var(--bg-grey);
  font-weight: 700;
  font-size: 1.05rem;
}

.grand-total-row td {
  background-color: var(--bg-grey) !important;
  color: var(--primary);
}

/* ==========================================================================
   Section 2: Files & Documents
   ========================================================================== */
.split-view-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.split-left-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.split-inquiry-item {
  background-color: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.split-inquiry-item:hover {
  border-color: var(--secondary);
  box-shadow: 0 12px 20px -5px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
  transform: translateY(-4px) scale(1.02);
}

.split-inquiry-item.selected {
  border-color: var(--secondary);
  background: linear-gradient(135deg, var(--secondary-light) 0%, #f0f7ff 100%);
  box-shadow: 0 8px 15px -3px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px) scale(1.01);
}

.document-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.document-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  align-items: center;
  gap: 1rem;
  background-color: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: var(--transition);
}

.document-row:hover {
  box-shadow: 0 6px 12px -2px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  border-color: var(--secondary);
}

.doc-name-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.doc-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
}

.doc-status-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.doc-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.doc-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.file-input-wrapper input[type=file] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
}

/* ==========================================================================
   Section 3: Material Arrangement
   ========================================================================== */
.slider-group {
  margin: 1.25rem 0;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.progress-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: var(--border-light);
  outline: none;
  border-radius: 3px;
}

.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary);
  cursor: pointer;
  transition: var(--transition);
}

.progress-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--secondary-hover);
}

.attachment-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.thumb-preview {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

/* ==========================================================================
   Section 4: Work Done At Site
   ========================================================================== */
.site-details-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.site-meta-item {
  display: flex;
  flex-direction: column;
}

.site-meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.site-meta-val {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
}

/* ==========================================================================
   Section 5: Payment Complete
   ========================================================================== */
.payment-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.payment-summary-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.summary-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.summary-amount-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.amount-label {
  font-weight: 500;
  font-size: 0.9rem;
}

.amount-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.amount-val.total {
  color: var(--primary);
}

.amount-val.received {
  color: var(--success);
}

.amount-val.pending {
  color: var(--pending);
}

.amount-val.pending.complete {
  color: var(--success);
}

/* Ledger Table */
.table-ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-ledger th {
  background-color: var(--bg-grey);
  padding: 0.75rem;
  border-bottom: 2px solid var(--border-light);
  text-align: left;
}

.table-ledger td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

/* ==========================================================================
   Employee Management
   ========================================================================== */
.employee-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.employee-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.employee-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.employee-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--secondary-light);
  color: var(--secondary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.employee-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.employee-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.employee-contact {
  font-size: 0.85rem;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.employee-actions {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  animation: modalSlideUp 0.2s ease-out;
}

.modal-content.wide {
  max-width: 800px;
}

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

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

.modal-header {
  padding: 1.25rem 1.5rem;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  color: white;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
  transition: var(--transition);
}

.modal-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: var(--bg-grey);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Search results dropdown panel under top bar */
.search-results-panel {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  max-height: 400px;
  overflow-y: auto;
  z-index: 101;
  display: none;
}

.search-results-panel.active {
  display: block;
}

.search-result-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: var(--secondary-light);
}

.search-result-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.search-result-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Notifications list dropdown panel */
.notifications-dropdown {
  position: absolute;
  top: 110%;
  right: 0;
  width: 320px;
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  max-height: 450px;
  overflow-y: auto;
  z-index: 101;
  display: none;
}

.notifications-dropdown.active {
  display: block;
}

.notifications-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-weight: 700;
  font-size: 0.9rem;
  background-color: var(--bg-grey);
}

.notification-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  transition: var(--transition);
}

.notification-item:hover {
  background-color: var(--bg-grey);
}

.notification-item-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.notification-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dashboard-split-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.hamburger-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--primary);
  cursor: pointer;
  padding: 0.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}

.hamburger-menu:hover {
  background-color: var(--bg-grey);
}

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

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  .hamburger-menu {
    display: inline-flex;
  }

  .sidebar-close-btn {
    display: inline-flex;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
  }

  .sidebar-close-btn:hover {
    color: white;
  }

  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 70px 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    background-color: var(--primary);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--border-light);
  }

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

  .sidebar-brand {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-menu {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem 0.75rem;
    width: 100%;
    align-items: stretch;
    flex: 1;
  }

  .sidebar-menu-item {
    width: 100%;
  }

  .sidebar-menu-item a {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: var(--radius-sm);
  }

  .sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .btn-logout {
    width: 100%;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .login-container {
    flex-direction: column;
  }

  .login-left {
    padding: 2rem;
    align-items: center;
    text-align: center;
  }

  .login-left h1 {
    font-size: 2.25rem;
  }

  .login-right {
    width: 100%;
    padding: 1.5rem 1rem;
  }

  .split-view-container {
    grid-template-columns: 1fr;
  }

  .payment-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-split-columns {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Adjust top header padding */
  .app-header {
    padding: 0 1.25rem;
  }
}

/* ==========================================================================
   KANBAN BOARD STYLES
   ========================================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1rem;
}

.kanban-col {
  background-color: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 1rem;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--border-light);
}

.kanban-col-header {
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 2px solid;
  padding-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-col-header.todo {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.kanban-col-header.inprogress {
  border-color: var(--secondary);
  color: var(--secondary);
}

.kanban-col-header.waiting {
  border-color: var(--pending);
  color: var(--pending);
}

.kanban-col-header.completed {
  border-color: var(--success);
  color: var(--success);
}

.kanban-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 400px;
  overflow-y: auto;
}

.kanban-card {
  background-color: white;
  border-radius: 8px;
  padding: 0.85rem;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--secondary);
  cursor: grab;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kanban-card:hover {
  box-shadow: 0 15px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 12px -6px rgba(15, 23, 42, 0.08);
  transform: translateY(-6px) scale(1.03) translateZ(0);
  border-color: var(--secondary);
  background-color: var(--secondary-light) !important;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  color: var(--primary);
}

.kanban-card p {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin: 0;
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.725rem;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  padding-top: 0.4rem;
  margin-top: 0.25rem;
}

/* ==========================================================================
   CALENDAR VIEW STYLES
   ========================================================================== */
.calendar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.calendar-grid-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.calendar-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-day {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: white;
  padding: 0.5rem;
  min-height: 95px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.calendar-day:hover {
  border-color: var(--border-focus);
}

.calendar-day.empty {
  background-color: #f8fafc;
  border-color: #f1f5f9;
}

.calendar-day.today {
  border-color: var(--secondary);
  background-color: var(--secondary-light);
}

.calendar-day-number {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.calendar-event {
  font-size: 0.675rem;
  background-color: var(--secondary);
  color: white;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-weight: 500;
}

.calendar-event.overdue {
  background-color: #EF4444;
}

/* ==========================================================================
   AI ASSISTANT CHAT DRAWER
   ========================================================================== */
.ai-chat-bubble {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--secondary);
  color: white;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: var(--transition);
  z-index: 999;
}

.ai-chat-bubble:hover {
  transform: scale(1.1);
  background-color: var(--secondary-hover);
}

.ai-chat-drawer {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  width: 380px;
  height: 500px;
  border-radius: var(--radius-md);
  background-color: white;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 999;
}

.ai-chat-drawer.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.ai-chat-header {
  background-color: var(--secondary);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-chat-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: #f8fafc;
}

.ai-chat-msg {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  max-width: 80%;
  font-size: 0.825rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.ai-chat-msg.bot {
  background-color: white;
  border: 1px solid var(--border-light);
  align-self: flex-start;
  color: var(--text-dark);
  border-bottom-left-radius: 2px;
}

.ai-chat-msg.user {
  background-color: var(--secondary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.ai-chat-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.5rem;
  background-color: white;
}

.ai-chat-footer input {
  flex: 1;
  border: 1px solid var(--border-light);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.ai-chat-footer input:focus {
  border-color: var(--secondary);
}

.ai-chat-footer button {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--secondary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.ai-chat-footer button:hover {
  background-color: var(--secondary-hover);
}

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

  .ai-chat-drawer {
    width: calc(100% - 2rem);
    right: 1rem;
    left: 1rem;
    bottom: 5.5rem;
  }

  .form-grid-2col {
    grid-template-columns: 1fr;
  }

  /* Forms element layout grids */
  .card div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Make header right profiles more compact */
  .user-info {
    display: none;
  }

  .user-profile-widget {
    padding: 0;
    background: none;
    border: none;
  }

  /* Adjust modals spacing */
  .modal-content {
    width: 95% !important;
    padding: 1.25rem !important;
  }

  .modal-content.wide {
    width: 95% !important;
  }
}

/* ==========================================================================
   Themes Configuration (Default, Light, Dark)
   ========================================================================== */

/* 1. Default Theme Variables (Original Slate & Royal Blue) */
body.theme-default {
  --primary: #0F172A;
  --secondary: #2563EB;
  --secondary-light: #EFF6FF;
  --secondary-hover: #1D4ED8;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --pending: #F59E0B;
  --pending-light: #FEF3C7;
  --bg-grey: #F8FAFC;
  --card-white: #FFFFFF;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --border-focus: #93C5FD;
}

/* 2. Light Theme Variables (Sky Blue & Soft Slate) */
body.theme-light {
  --primary: #0F172A;
  --secondary: #0EA5E9;
  --secondary-light: #F0F9FF;
  --secondary-hover: #0284C7;
  --success: #10B981;
  --success-light: #D1FAE5;
  --pending: #F59E0B;
  --pending-light: #FEF3C7;
  --bg-grey: #FAFAFA;
  --card-white: #FFFFFF;
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  --border-light: #E5E7EB;
  --border-focus: #38BDF8;
}

/* 3. Dark Theme Variables (Deep Charcoal & Radiant Blue) */
body.theme-dark {
  --primary: #F8FAFC;
  --secondary: #3B82F6;
  --secondary-light: #1E293B;
  --secondary-hover: #60A5FA;
  --success: #34D399;
  --success-light: #064E3B;
  --pending: #FBBF24;
  --pending-light: #78350F;
  --bg-grey: #0B0F19;
  --card-white: #151F32;
  --text-dark: #E2E8F0;
  --text-muted: #94A3B8;
  --border-light: #243249;
  --border-focus: #60A5FA;
}

/* Theme-specific styles overrides */
body.theme-dark .app-sidebar {
  background: linear-gradient(135deg, #090d16 0%, #151f32 50%, #090d16 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  border-right: 1px solid var(--border-light);
}

body.theme-dark .sidebar-menu-item.active a {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

body.theme-dark .sidebar-menu-item a:hover {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

body.theme-dark select option {
  background-color: #151F32;
  color: #E2E8F0;
}

body.theme-dark .modal-content {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Settings Nav Cards */
.settings-nav-card {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.settings-nav-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--secondary) !important;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
}
.settings-nav-card.active {
  border-color: var(--secondary) !important;
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--card-bg, #ffffff) 100%) !important;
  box-shadow: 0 8px 15px -3px rgba(37, 99, 235, 0.15);
}

body.theme-dark .settings-nav-card.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, #151F32 100%) !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes statusPulseOnline {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes statusPulseOffline {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}