:root {
  /* The Economist Color Palette */
  --economist-red: #E3120B;
  --economist-red-dark: #B50D08;
  --economist-red-light: #FF4136;
  --primary: var(--economist-red);
  --primary-hover: var(--economist-red-dark);
  
  /* Neutral Colors */
  --white: #FFFFFF;
  --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;
  
  /* Semantic Colors */
  --success: #059669;
  --warning: #D97706;
  --danger: var(--economist-red);
  --gradient-primary: linear-gradient(135deg, var(--economist-red) 0%, var(--economist-red-dark) 100%);
  
  /* Layout */
  --bg-main: var(--gray-50);
  --bg-card: var(--white);
  --bg-sidebar: var(--white);
  --bg-hover: var(--gray-100);
  --text-main: var(--gray-800);
  --text-muted: var(--gray-500);
  --text-heading: var(--gray-900);
  --border: var(--gray-200);
  --border-light: var(--gray-100);
  --sidebar-width: 220px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 4px;
  --radius-sm: 2px;
  
  /* Typography */
  --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-main);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
}

/* Sidebar */
aside {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  z-index: 10;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--economist-red);
  margin-bottom: 2rem;
  padding: 0 0.75rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
}

.nav-item.active {
  background: rgba(227, 18, 11, 0.08);
  color: var(--economist-red);
  border-left-color: var(--economist-red);
  font-weight: 600;
}

/* Main Content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.25rem 2rem;
}

header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-heading);
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0;
}

/* Table Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: auto;
  max-height: calc(100vh - 180px);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

th {
  background: var(--gray-100);
  padding: 0.75rem 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--gray-50);
}

/* ========== Summary Page Styles ========== */
.summary-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
}

.section-header h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--economist-red);
  margin-right: 0.75rem;
}

.filter-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-item label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-item select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  min-width: 150px;
  transition: all 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

.filter-item select:hover {
  border-color: var(--gray-400);
}

.filter-item select:focus {
  outline: none;
  border-color: var(--economist-red);
  box-shadow: 0 0 0 2px rgba(227, 18, 11, 0.1);
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
  margin-bottom: 0.5rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding-top: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Expense List Table Styles */
.expense-list-container {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.expense-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.expense-list-table th {
  background: var(--gray-100);
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.expense-list-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.expense-list-table tbody tr:hover {
  background: var(--gray-50);
}

.expense-list-table .amount-cell {
  font-family: Verdana, Geneva, sans-serif;
  text-align: right;
  color: var(--text-heading);
  font-weight: 500;
  font-size: 0.75rem;
}

.expense-list-table .date-cell {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.expense-list-table .header-group {
  background: var(--economist-red);
  color: #FFFFFF !important;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
}

.expense-list-table .header-group:hover {
  background: var(--economist-red);
}

.expense-list-table .header-group td {
  border-bottom: none;
  padding: 0.5rem 0.75rem;
  color: #FFFFFF !important;
  font-family: var(--font-sans);
}

.expense-list-table .header-group:hover td {
  background: var(--economist-red);
}

.expense-list-table .header-group .group-title {
  font-weight: 600;
  color: #FFFFFF !important;
  font-family: var(--font-sans);
}

.expense-list-table .header-group span {
  color: #FFFFFF !important;
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

.expense-list-summary {
  display: flex;
  gap: 2rem;
  padding: 1rem 1.25rem;
  background: var(--gray-100);
  border-radius: var(--radius);
  margin-top: 1rem;
  justify-content: flex-end;
  border: 1px solid var(--border);
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.summary-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-heading);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

/* Existing styles */

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  width: 300px;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: var(--text-bright);
}

.modal-content input {
  width: 100%;
  padding: 12px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-content button {
  width: 100%;
  padding: 12px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-content button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

tr:hover td {
  background: var(--bg-hover);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-waiting {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-confirmed {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Settings Page Styles */
.settings-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.settings-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.settings-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow), var(--shadow-glow);
  border-color: var(--primary);
}

.settings-card:hover::before {
  opacity: 1;
}

.settings-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-bright);
}

.settings-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Manage View Header */
.manage-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.manage-header h2 {
  flex: 1;
  font-size: 1.5rem;
  color: var(--text-bright);
}

/* Buttons */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text-bright);
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  margin-right: 0.25rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-edit {
  background: var(--primary);
  color: white;
}

.btn-edit:hover {
  background: var(--primary-hover);
}

.btn-delete {
  background: var(--danger);
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
}

/* Container and Sidebar fix */
.container {
  display: flex;
  width: 100%;
  height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
}

.main-content {
  flex: 1;
  padding: 2rem 3rem;
  overflow-y: auto;
  background: transparent;
}

#page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

/* Logout button */
#logout-btn {
  background: transparent !important;
  border: 1px solid var(--gray-300) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius) !important;
  transition: all 0.15s ease !important;
  font-family: var(--font-sans) !important;
  font-weight: 500 !important;
}

#logout-btn:hover {
  background: var(--gray-100) !important;
  border-color: var(--gray-400) !important;
  color: var(--text-main) !important;
}

/* Review Invoice Page Styles */
.review-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.review-tab {
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: all 0.15s ease;
  background: var(--white);
  color: var(--text-muted);
}

.review-tab.active {
  background: var(--economist-red);
  border-color: var(--economist-red);
  color: white;
}

.review-tab:not(.active):hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--text-main);
}

.review-split-layout {
  display: flex;
  gap: 1rem;
  height: calc(100vh - 200px);
}

.review-left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.review-records-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}

.review-records-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-bright);
}

.review-records-header span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.review-table-container {
  flex: 1;
  overflow: auto;
}

/* Adjusted for better visibility */
.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.review-table th {
  background: var(--bg-hover);
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.review-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
  color: var(--text-main);
}

.review-row {
  cursor: pointer;
  transition: background 0.15s;
}

.review-row:hover {
  background: var(--bg-hover);
}

.review-row.selected {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--primary);
}

.review-row.reviewed {
  opacity: 0.6;
}

.review-row.submit-selected {
  background: rgba(16, 185, 129, 0.15);
}

.review-row.submit-selected:hover {
  background: rgba(16, 185, 129, 0.25);
}

.review-row.reviewed .review-btn {
  background: #94a3b8;
}

.review-record-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.review-record-item:hover {
  background: #f1f5f9;
}

.review-record-item.selected {
  background: #e0f2fe;
  border-color: var(--primary);
}

.review-record-item.reviewed {
  opacity: 0.6;
}

.review-record-item.reviewed .review-btn {
  background: #94a3b8;
}

.review-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: white;
  margin-right: 0.75rem;
  white-space: nowrap;
}

.review-btn:hover {
  background: var(--primary-hover);
}

.review-record-info {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
}

.review-record-info .record-field {
  min-width: 100px;
}

.review-record-info .field-label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.review-record-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-right-panel {
  width: 480px;
  /* Increased from 400px */
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ... existing ... */

.detail-field input,
.detail-field select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  /* Reduced from 0.875rem */
}

.review-row {
  cursor: pointer;
  transition: background 0.15s;
}

.review-row:hover {
  background: #f1f5f9;
}

.review-row.selected {
  background: #e0f2fe;
}

.review-row.reviewed {
  opacity: 0.6;
}

.review-row.submit-selected {
  background: #dcfce7;
}

.review-row.submit-selected:hover {
  background: #bbf7d0;
}

.review-row.reviewed .review-btn {
  background: #94a3b8;
}

.review-record-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.review-record-item:hover {
  background: #f1f5f9;
}

.review-record-item.selected {
  background: #e0f2fe;
  border-color: var(--primary);
}

.review-record-item.reviewed {
  opacity: 0.6;
}

.review-record-item.reviewed .review-btn {
  background: #94a3b8;
}

.review-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: white;
  margin-right: 0.75rem;
  white-space: nowrap;
}

.review-btn:hover {
  background: var(--primary-hover);
}

.review-record-info {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
}

.review-record-info .record-field {
  min-width: 100px;
}

.review-record-info .field-label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.review-record-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-right-panel {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-detail-form {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

.review-detail-form h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-bright);
}

.review-attachment-preview {
  height: 400px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.review-attachment-preview h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--text-bright);
}

#attachment-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: grab;
}

#attachment-container:active {
  cursor: grabbing;
}

#attachment-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#attachment-container img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.1s ease-out;
  user-select: none;
  pointer-events: none;
}

.detail-field {
  margin-bottom: 0.75rem;
}

.detail-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-field input,
.detail-field select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.detail-field input:focus,
.detail-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Progress Modal Styles */
.progress-container {
  margin: 1.5rem 0;
}

.progress-bar {
  width: 100%;
  height: 24px;
  background: var(--bg-main);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 12px;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.progress-text {
  margin-top: 0.75rem;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
}

.progress-status {
  color: var(--primary-light);
  font-size: 0.9rem;
  margin-top: 1rem;
  min-height: 1.5rem;
}

.progress-details {
  margin-top: 1rem;
  max-height: 120px;
  overflow-y: auto;
  text-align: left;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
}

.progress-details .success {
  color: var(--success);
}

.progress-details .error {
  color: var(--danger);
}

.progress-details .item {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}

.progress-details .item:last-child {
  border-bottom: none;
}

/* Loading Skeleton Animation */
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 0%, var(--border) 50%, var(--bg-hover) 100%);
  background-size: 200% 100%;
  animation: pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.delete-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--gray-500);
  color: white;
  margin-left: 5px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.delete-btn:hover {
  background: var(--gray-600);
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */

.login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-container {
  background: var(--bg-card);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--economist-red);
  margin-bottom: 2rem;
  line-height: 1.3;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.login-form .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.login-form .form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-main);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 18, 11, 0.1);
}

.login-form .form-group input::placeholder {
  color: var(--text-muted);
}

.login-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  min-height: 1.25rem;
}

.login-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.login-btn {
  flex: 1;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.login-btn.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
}

.login-btn.btn-primary:hover {
  background: var(--primary-hover);
}

.login-btn.btn-secondary {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.login-btn.btn-secondary:hover {
  background: var(--bg-hover);
}

/* ========================================
   SIDEBAR FOOTER & USER INFO STYLES
   ======================================== */

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-welcome {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-main);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.welcome-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.5rem;
}

.sidebar-btn {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
}

.sidebar-btn:hover {
  background: var(--bg-hover);
}

.sidebar-btn.logout-btn {
  background: var(--gray-600);
  color: white;
  border: none;
}

.sidebar-btn.logout-btn:hover {
  background: var(--gray-700);
}

/* ========================================
   EDIT MODAL FORM STYLES
   ======================================== */

#edit-modal .modal-content {
  background: var(--white);
  max-height: 80vh;
  overflow-y: auto;
  width: 450px;
  text-align: left;
}

#edit-modal-title {
  text-align: center;
  color: var(--text-heading);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.edit-field-group {
  margin-bottom: 1rem;
}

.edit-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-align: center;
}

.edit-input,
.edit-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.edit-input:focus,
.edit-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 18, 11, 0.1);
}

.edit-input.readonly,
.edit-select.readonly {
  background: var(--gray-100);
  color: var(--text-muted);
  cursor: not-allowed;
}

.edit-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.edit-field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  text-align: center;
}

#edit-form button[type="submit"],
#edit-form #cancel-edit {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

#edit-form button[type="submit"] {
  background: var(--primary);
  color: white;
  border: none;
}

#edit-form button[type="submit"]:hover {
  background: var(--primary-hover);
}

#edit-form #cancel-edit {
  background: var(--gray-100);
  color: var(--text-main);
  border: 1px solid var(--border);
}

#edit-form #cancel-edit:hover {
  background: var(--gray-200);
}