/* Stylesheet for Reimbursement Management System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

:root {
  /* Common Variables */
  --font-sans: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  
  /* Light Theme Variables */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);
  
  --success: #10b981;
  --success-hover: #059669;
  --success-light: rgba(16, 185, 129, 0.1);
  
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: rgba(245, 158, 11, 0.1);
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: rgba(239, 68, 68, 0.1);
  
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05), 0 20px 25px -5px rgb(0 0 0 / 0.05);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] {
  /* Dark Theme Variables */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #334155;
  --border-focus: #60a5fa;
  
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  
  --success: #10b981;
  --success-hover: #34d399;
  --success-light: rgba(16, 185, 129, 0.15);
  
  --warning: #fbbf24;
  --warning-hover: #fcd34d;
  --warning-light: rgba(251, 191, 36, 0.15);
  
  --danger: #f87171;
  --danger-hover: #fca5a5;
  --danger-light: rgba(248, 113, 113, 0.15);
  
  --card-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* CSS Resets & General Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

/* Theme Switcher Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.theme-toggle-btn:hover {
  background: var(--bg-tertiary);
  transform: rotate(15deg);
}

/* Login Page Overlay */
#login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  padding: 20px;
  background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent 40%);
}

.login-card {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  text-align: center;
  animation: fadeInDown 0.5s ease-out;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--success));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
}

.logo-container h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card p {
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.input-with-icon {
  position: relative;
}

.input-with-icon input,
.input-with-icon select,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.input-with-icon input {
  padding-left: 44px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg-secondary);
}

input:focus + .input-icon {
  color: var(--primary);
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.btn-primary:disabled {
  background: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: var(--success-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Quick Profiles Switcher */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 24px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.divider:not(:empty)::before {
  margin-right: .5em;
}
.divider:not(:empty)::after {
  margin-left: .5em;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.profile-card {
  padding: 12px 8px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.profile-card:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  transform: translateY(-2px);
}
.profile-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px auto;
  font-weight: bold;
  font-size: 0.85rem;
}
.profile-card:nth-child(2) .profile-card-icon {
  background: var(--warning-light);
  color: var(--warning);
}
.profile-card:nth-child(3) .profile-card-icon {
  background: var(--success-light);
  color: var(--success);
}
.profile-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.profile-card-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* User Info/Registration Dialog */
#setup-dialog {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dialog-content {
  width: 100%;
  max-width: 440px;
  padding: 30px;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dialog-header {
  margin-bottom: 20px;
}
.dialog-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}
.dialog-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

.dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Main Dashboard Layout */
#app-container {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Navigation Header */
header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--success));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-item button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
}

.nav-item button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active button {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-tertiary);
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

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

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

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

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

.role-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-left: 4px;
}

.role-tag-employee { background: var(--primary-light); color: var(--primary); }
.role-tag-manager { background: var(--warning-light); color: var(--warning); }
.role-tag-finance { background: var(--success-light); color: var(--success); }

/* Main Dashboard Panel */
main {
  flex: 1;
  padding: 32px 0;
  animation: fadeIn 0.4s ease-out;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: slideUp 0.3s ease-out;
}

/* Tab 1: Reimburse View Columns */
.reimburse-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 992px) {
  .reimburse-grid {
    grid-template-columns: 1fr;
  }
}

.form-panel {
  padding: 30px;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.tag-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* File Upload Zone */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-tertiary);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.upload-zone:hover .upload-icon {
  color: var(--primary);
  transform: translateY(-2px);
  transition: var(--transition-smooth);
}

.upload-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

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

#file-input {
  display: none;
}

.upload-preview {
  display: none;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  max-height: 180px;
  border: 1px solid var(--border-color);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-upload {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.remove-upload:hover {
  background: var(--danger);
  transform: scale(1.1);
}

.demo-receipt-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--primary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
}

/* Receipt Preview (Wow factor!) */
.receipt-stub-container {
  position: sticky;
  top: 100px;
}

.receipt-stub {
  background: #ffffff;
  color: #1e293b;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
}

/* Receipt jagged bottom edges */
.receipt-stub::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(-45deg, var(--bg-primary) 4px, transparent 0), linear-gradient(45deg, var(--bg-primary) 4px, transparent 0);
  background-position: left bottom;
  background-repeat: repeat-x;
  background-size: 8px 8px;
}

.receipt-header {
  text-align: center;
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.receipt-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.receipt-sub {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.receipt-row.total {
  border-top: 2px dashed #cbd5e1;
  padding-top: 14px;
  margin-top: 20px;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.receipt-row span:first-child {
  color: #64748b;
  font-weight: 600;
}

.receipt-row span:last-child {
  color: #1e293b;
  text-align: right;
  word-break: break-all;
  max-width: 60%;
}

.receipt-image-preview {
  margin-top: 20px;
  border: 1px solid #e2e8f0;
  padding: 6px;
  border-radius: 8px;
  background: #f8fafc;
  transform: rotate(-1.5deg);
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  display: none;
}

.receipt-image-preview img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 4px;
}

.receipt-barcode {
  text-align: center;
  margin: 30px auto 10px auto;
  opacity: 0.75;
}
.receipt-barcode svg {
  max-width: 100%;
  height: auto;
}

/* Metric Cards Dashboard Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-left {
  display: flex;
  flex-direction: column;
}

.metric-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon.primary { background: var(--primary-light); color: var(--primary); }
.metric-icon.success { background: var(--success-light); color: var(--success); }
.metric-icon.warning { background: var(--warning-light); color: var(--warning); }
.metric-icon.danger { background: var(--danger-light); color: var(--danger); }

/* Table Container & Table Styles */
.table-panel {
  padding: 24px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pending-badge {
  background: var(--warning-light);
  color: var(--warning);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.table-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

thead {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

th {
  padding: 14px 18px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 16px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

tr:hover td {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Checkbox Styles */
.checkbox-cell {
  width: 40px;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.custom-checkbox:hover {
  border-color: var(--primary);
}

.custom-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.custom-checkbox svg {
  display: none;
  width: 12px;
  height: 12px;
  stroke: white;
  stroke-width: 3;
}

.custom-checkbox.checked svg {
  display: block;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.775rem;
  font-weight: 600;
}

.status-badge-pending-manager {
  background: var(--warning-light);
  color: var(--warning);
}
.status-badge-pending-finance {
  background: var(--primary-light);
  color: var(--primary);
}
.status-badge-approved {
  background: var(--success-light);
  color: var(--success);
}
.status-badge-rejected-manager,
.status-badge-rejected-finance {
  background: var(--danger-light);
  color: var(--danger);
}

/* Receipt Thumbnail Column */
.receipt-thumbnail {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
}
.receipt-thumbnail:hover {
  transform: scale(1.08);
  border-color: var(--primary);
}
.receipt-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.receipt-thumbnail svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* Row Action Buttons Wrapper */
.action-btns {
  display: flex;
  gap: 8px;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon-only:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.btn-icon-only.approve:hover {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}
.btn-icon-only.reject:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-icon-only svg {
  width: 16px;
  height: 16px;
}

/* Finance Filters Grid */
.filters-panel {
  padding: 20px;
  margin-bottom: 24px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.filters-grid .form-group {
  margin-bottom: 0;
}

.filter-dates {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-dates input {
  flex: 1;
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
  animation: scaleIn 0.3s ease;
  background: white;
  padding: 10px;
}

.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: white;
  background: rgba(255,255,255,0.1);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.25);
  transform: rotate(90deg);
}
.lightbox-caption {
  color: white;
  text-align: center;
  margin-top: 16px;
  font-size: 0.95rem;
}

/* Toast Messages */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  padding: 16px 20px;
  border-radius: 8px;
  color: white;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideInLeft 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

.toast-icon {
  width: 20px;
  height: 20px;
}
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--primary); }

.toast-message {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Empty State Styles */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}
.empty-state p {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Flow Path Visualization in Table Row */
.flow-steps {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
}
.flow-step {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-weight: 500;
}
.flow-step.active {
  color: var(--primary);
  font-weight: 600;
}
.flow-step.completed {
  color: var(--success);
}
.flow-step.rejected {
  color: var(--danger);
  text-decoration: line-through;
}
.flow-arrow {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Confetti particles for submittal success */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2500;
  overflow: hidden;
}
.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  opacity: 0;
  animation: fall 2.5s ease-out forwards;
}
@keyframes fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(720deg);
    opacity: 0;
  }
}
