/* CSS Variables */
:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #fff7ed;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --dark-bg: #1a1a1a;
  --dark-surface: #252525;
  --dark-border: #333333;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --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);
  --shadow-sidebar: 2px 0 8px rgb(0 0 0 / 0.08);
  --shadow-card: 0 2px 8px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-card-hover: 0 8px 16px rgb(0 0 0 / 0.12), 0 2px 4px rgb(0 0 0 / 0.06);
  --shadow-btn: 0 1px 3px rgb(0 0 0 / 0.12), 0 1px 2px rgb(0 0 0 / 0.08);
  --shadow-input-focus: 0 0 0 3px var(--primary-light), 0 1px 2px rgb(0 0 0 / 0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--gray-50);
}

/* Utilities */
.hidden { display: none !important; }
.accent { color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-btn);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 4px rgb(249 115 22 / 0.3), var(--shadow-btn);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 8px rgb(249 115 22 / 0.35), var(--shadow-md);
}

.btn-outline {
  background: var(--white);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
}

.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-with-arrow {
  background: var(--primary);
  color: var(--white);
  padding: 10px 16px;
}

.btn-outline-arrow {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  padding: 10px 16px;
}

.btn-outline-arrow:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-arrow {
  font-size: 10px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  min-width: 180px;
  padding: 8px 0;
  margin-top: 4px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
}

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

.dropdown-item {
  display: block;
  padding: 10px 16px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--primary);
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0;
}

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

.summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 20px;
  flex-shrink: 0;
}

.summary-card-content {
  flex: 1;
  min-width: 0;
}

.summary-card-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.summary-card-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-input-focus);
}

/* Items checklist for multi-select */
.items-checklist {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
}

.item-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
}

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

.item-checkbox:hover {
  background: var(--gray-50);
}

.item-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.item-checkbox .item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-checkbox .item-info strong {
  font-size: 14px;
  color: var(--gray-800);
}

.item-checkbox .item-meta {
  font-size: 12px;
  color: var(--gray-500);
}

/* Subgroup checklist for vendor modal */
.subgroup-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--white);
}

.subgroup-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.subgroup-checkbox:hover {
  background: var(--gray-50);
}

.subgroup-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.subgroup-checkbox .subgroup-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subgroup-checkbox .subgroup-info strong {
  font-size: 13px;
  color: var(--gray-800);
}

.subgroup-checkbox .subgroup-info span {
  font-size: 11px;
  color: var(--gray-500);
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
  accent-color: var(--primary);
}

/* Login Screen */
.login-screen {
  display: flex;
  min-height: 100vh;
}

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark-bg) 0%, #2d1f1f 100%);
  padding: 40px;
}

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

.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hex-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-surface);
  border: 2px solid var(--dark-border);
  border-radius: 12px;
  font-size: 24px;
  color: var(--gray-400);
}

.flow-step.active .hex-icon {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.flow-line {
  width: 40px;
  height: 2px;
  background: var(--dark-border);
}

.flow-label {
  font-size: 12px;
  color: var(--gray-400);
}

.tagline {
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  color: var(--white);
  margin-bottom: 10px;
}

.tagline-sub {
  font-size: 14px;
  color: var(--gray-400);
}

.brand-accent {
  color: var(--primary);
  font-weight: 600;
}

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--gray-50);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.logo-img {
  width: 80px;
  height: 80px;
  margin-bottom: 10px;
  object-fit: contain;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-800);
}

.logo-subtitle {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gray-500);
  margin-top: 4px;
}

.login-card h1 {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.login-hint {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.forgot-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
}

.forgot-link:hover {
  text-decoration: underline;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--gray-500);
}

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

/* Sidebar - Light Theme */
.sidebar {
  width: 220px;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon-sm {
  font-size: 24px;
}

.logo-icon-sm-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.logo-text-sm {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}

.sidebar-toggle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-500);
}

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

.nav-section {
  margin-bottom: 20px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  padding: 0 8px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--gray-600);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s;
  font-size: 14px;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-800);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 4px rgb(249 115 22 / 0.3);
}

.nav-icon {
  font-size: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon.material-icons {
  font-size: 20px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--gray-200);
}

.user-info {
  margin-bottom: 12px;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}

.sidebar-footer .btn-outline {
  background: transparent;
  border-color: var(--gray-300);
  color: var(--gray-600);
}

.sidebar-footer .btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--primary);
  color: var(--primary);
}

.powered-by {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  margin-top: 12px;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed .logo-text-sm,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .user-name,
.sidebar.collapsed .powered-by,
.sidebar.collapsed .btn-outline span {
  display: none;
}

.sidebar.collapsed .logo-small {
  justify-content: center;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px;
}

.sidebar.collapsed .sidebar-toggle {
  position: absolute;
  right: 8px;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 8px;
}

.sidebar.collapsed .nav-icon {
  margin: 0;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 8px;
  text-align: center;
}

.sidebar.collapsed .sidebar-footer .btn-outline {
  padding: 6px;
  width: 100%;
  justify-content: center;
}

.main-content.sidebar-collapsed {
  margin-left: 60px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 220px;
  min-height: 100vh;
  background: var(--gray-100);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(135deg, #3d2a2a 0%, #2a1f1f 100%);
  border-bottom: 1px solid var(--dark-border);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
  position: sticky;
  top: 0;
  z-index: 50;
}

.search-bar {
  position: relative;
  width: 300px;
}

.search-bar .search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  padding-right: 60px;
}

.search-bar .search-input::placeholder {
  color: var(--gray-400);
}

.search-bar .search-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
}

.search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray-400);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.notification-badge {
  background: var(--primary);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-live {
  color: var(--success);
  font-size: 13px;
}

/* Site selector */
.user-site-selector {
  display: flex;
  align-items: center;
}

.site-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  min-width: 140px;
}

.site-select:hover {
  background: rgba(255, 255, 255, 0.15);
}

.site-select:focus {
  outline: none;
  border-color: var(--primary);
}

.site-select option {
  background: var(--gray-800);
  color: var(--white);
}

/* User info */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-name {
  color: var(--white);
  font-weight: 500;
  font-size: 13px;
}

.user-role {
  color: var(--gray-400);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* User dropdown menu */
.user-menu {
  position: absolute;
  top: 100%;
  right: 24px;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
}

.user-menu-header {
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.user-menu-header strong {
  display: block;
  color: var(--gray-800);
  font-size: 14px;
}

.user-menu-header span {
  color: var(--gray-500);
  font-size: 12px;
}

.user-menu-item {
  padding: 10px 16px;
  color: var(--gray-700);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu-item:hover {
  background: var(--gray-100);
}

.page-content {
  padding: 24px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
}

.page-title-icon {
  font-size: 24px;
}

.page-subtitle {
  color: var(--gray-500);
  font-size: 14px;
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 12px;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s ease;
}

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

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}

.card-body {
  padding: 20px;
}

/* Dashboard Hero Section */
.dashboard-hero {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  border: 1px solid var(--gray-200);
}

.hero-main {
  flex: 2;
}

.hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 8px;
}

.hero-greeting {
  font-size: 32px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.hero-subtitle {
  color: var(--gray-500);
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-focus {
  flex: 1;
  background: var(--dark-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: var(--white);
  min-width: 280px;
}

.focus-header {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.focus-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.focus-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--dark-surface);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.focus-item-text {
  font-size: 14px;
}

.focus-item-sub {
  font-size: 12px;
  color: var(--gray-500);
}

.focus-item-arrow {
  color: var(--gray-400);
}

/* Dashboard Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

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

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-value.red { color: var(--primary); }
.stat-value.green { color: var(--success); }
.stat-value.yellow { color: var(--warning); }

.stat-label {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}

.stat-sub {
  font-size: 12px;
  color: var(--gray-400);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* PO Pipeline Card */
.pipeline-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pipeline-title {
  font-size: 16px;
  font-weight: 600;
}

.pipeline-badge {
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray-600);
}

.pipeline-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.pipeline-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 20px;
}

.pipeline-segment {
  height: 100%;
}

.pipeline-segment.green { background: var(--success); }
.pipeline-segment.yellow { background: var(--warning); }
.pipeline-segment.red { background: var(--primary); }

.pipeline-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pipeline-stat {
  text-align: center;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.pipeline-stat-label {
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pipeline-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-800);
}

.pipeline-legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--gray-500);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.green { background: var(--success); }
.legend-dot.red { background: var(--primary); }
.legend-dot.yellow { background: var(--warning); }

/* Sidebar Cards */
.sidebar-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.attention-icon {
  width: 32px;
  height: 32px;
  background: var(--gray-200);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.attention-text {
  flex: 1;
}

.attention-text strong {
  display: block;
  font-size: 13px;
}

.attention-text span {
  font-size: 11px;
  color: var(--gray-500);
}

/* Jump In Grid */
.jump-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.jump-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.jump-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Workflow Steps */
.workflow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  border: 1px solid var(--gray-200);
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.step-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: 8px;
  font-size: 14px;
}

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
}

.step-desc {
  font-size: 11px;
  color: var(--gray-400);
}

.workflow-arrow {
  color: var(--gray-300);
  font-size: 20px;
}

/* Filters */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-input {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.filter-select {
  width: 150px;
}

/* Keyboard Shortcuts Indicator */
.keyboard-hints {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--gray-400);
}

.keyboard-hints span {
  color: var(--gray-500);
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-family: 'Inter', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.kbd.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.kbd-hint {
  font-size: 10px;
  color: var(--gray-400);
  margin-right: 8px;
  margin-left: 2px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.data-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--gray-50);
}

.data-table tbody tr:hover {
  background: var(--gray-50);
  box-shadow: inset 3px 0 0 var(--primary);
}

.data-table td {
  font-size: 14px;
}

/* Row selection highlighting */
.data-table tbody tr.selected {
  background: var(--primary-light) !important;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
}

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

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

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

.badge-default {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-draft {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px dashed #818cf8;
}

.badge-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.badge-cancelled {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.badge-closed {
  background: #d1fae5;
  color: #059669;
  border: 1px solid #6ee7b7;
}

.badge-inprogress {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #93c5fd;
}

.badge-approved {
  background: #d1fae5;
  color: #059669;
  border: 1px solid #6ee7b7;
}

/* Action Icons */
.action-icons {
  display: flex;
  gap: 8px;
}

.action-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--gray-400);
  transition: all 0.2s;
}

.action-icon:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.action-icon.delete:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--gray-700);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Info Cards */
.info-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.info-card {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.info-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success-light);
  border-radius: 12px;
  font-size: 20px;
}

.info-card-icon.warning {
  background: var(--warning-light);
}

.info-card-icon.danger {
  background: var(--danger-light);
}

.info-card-content h3 {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.info-card-content .number {
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
}

.info-card-content .number.warning {
  color: var(--warning);
}

.info-card-content .number.danger {
  color: var(--danger);
}

.info-card-content p {
  font-size: 12px;
  color: var(--gray-500);
}

/* Modal */
.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;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 750px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25), 0 12px 24px -8px rgb(0 0 0 / 0.15);
}

.modal-content.modal-wide {
  max-width: 1400px;
  width: 95vw;
}

#po-lines input[type="number"] {
  width: 100%;
  padding: 8px 6px;
  font-size: 14px;
  text-align: right;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

#po-lines select {
  padding: 8px 6px;
  font-size: 14px;
}

#po-lines td {
  padding: 8px 4px;
  vertical-align: middle;
}

#po-lines .po-sl-no,
#po-lines .po-uom,
#po-lines .po-taxable-amt,
#po-lines .po-line-total {
  text-align: center;
  font-weight: 500;
}

#grn-lines input[type="number"] {
  width: 100%;
  padding: 8px 6px;
  font-size: 14px;
  text-align: right;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

#grn-lines input[type="text"],
#grn-lines select {
  padding: 8px 6px;
  font-size: 14px;
}

#grn-lines td {
  padding: 8px 4px;
  vertical-align: middle;
}

#grn-lines .grn-sl-no {
  text-align: center;
  font-weight: 500;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}

.modal-body {
  padding: 24px;
}

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

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

/* Item Lines Table */
.item-lines {
  margin-top: 20px;
}

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

.item-lines-header h4 {
  font-size: 14px;
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--gray-700);
}

/* GRN specific */
.grn-info {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.grn-info h4 {
  color: var(--primary-dark);
  margin-bottom: 8px;
  font-size: 14px;
}

.grn-info p {
  font-size: 13px;
  color: var(--gray-600);
}

/* Stock indicators */
.stock-low {
  background: var(--danger-light);
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* Keyboard shortcut help modal */
.shortcuts-help {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--gray-800);
  color: var(--white);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  max-width: 300px;
}

.shortcuts-help h4 {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--gray-300);
}

.shortcuts-help .shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.shortcuts-help .shortcut-row .kbd {
  background: var(--gray-700);
  border-color: var(--gray-600);
  color: var(--gray-200);
}

.shortcuts-help .shortcut-desc {
  color: var(--gray-400);
}

/* Progress bar for workflow steps */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.progress-fill {
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  flex: 1;
}

.progress-empty {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  flex: 1;
}

.progress-text {
  font-size: 11px;
  color: var(--gray-500);
  margin-left: 8px;
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar .nav-label,
  .sidebar .nav-section-title,
  .sidebar .logo-text-sm,
  .sidebar .user-name,
  .sidebar .powered-by {
    display: none;
  }

  .main-content {
    margin-left: 60px;
  }

  .login-left {
    display: none;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

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

  .dashboard-hero {
    flex-direction: column;
  }
}
