:root {
  --bg: #f5f1e6;
  --surface: #ffffff;
  --primary: #006837;
  --primary-soft: #daf1d8;
  --accent: #FFA500;
  --text: #3a2a1d;
  --muted: #6b3e1e;
  --border: #d0b79e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button, input, select, textarea {
  font: inherit;
}

.field-with-icon {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  background: #ffffff;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--primary-soft);
}

#app {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(26, 46, 86, 0.06);
  padding: 24px;
}

.hidden { display: none !important; }

.manager-only {
  display: block;
}

.manager-only.hidden {
  display: none !important;
}

.staff-only {
  display: block;
}

.staff-only.hidden {
  display: none !important;
}

.record-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.account-card-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.login-panel {
  /* center login panel in viewport */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 0;
  margin: 0;
}

#app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.table-form .form-grid {
  grid-template-columns: 1fr;
}

.form-grid label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  margin-top: 0;
}

.card-row {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.login-box {
  display: grid;
  gap: 14px;
  width: 360px;
  max-width: 96%;
  /* 3D effect with perspective and depth */
  perspective: 1000px;
  transform-style: preserve-3d;
  background: linear-gradient(135deg, #ffffff 0%, #f9f7f4 100%);
  border: 2px solid;
  border-image: linear-gradient(135deg, #006837 0%, #FFA500 50%, #006837 100%) 1;
  border-radius: 18px;
  padding: 32px;
  box-shadow:
    0 0 30px rgba(0, 104, 55, 0.5),
    0 0 20px rgba(255, 165, 0, 0.4),
    inset 0 0 20px rgba(0, 104, 55, 0.1),
    inset 0 0 15px rgba(255, 165, 0, 0.05),
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 15px 25px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* Animated border glow reflection */
.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 18px;
  padding: 2px;
  background: linear-gradient(135deg, #006837 0%, transparent 30%, transparent 70%, #FFA500 100%);
  z-index: -1;
  filter: blur(8px);
  opacity: 0.6;
  animation: border-glow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes border-glow {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.login-box h1 {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  position: relative;
  z-index: 1;
}

.login-box h2 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: var(--text);
  text-align: center;
}

.login-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

button {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 24px rgba(0, 104, 55, 0.18);
}

button:hover { opacity: 0.95; }

/* Standardize interactive button sizes across the app so HR and Manager views match */
.icon-btn,
button,
.tab-btn,
.hr-register-btn,
.scm-register-btn,
.pension-nav-btn,
.hr-register-nav button {
  padding: 10px 14px;
  font-size: 0.92rem;
  min-height: 40px;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-brand img {
  width: 64px;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
}

header h1 { margin: 0; font-size: 1.6rem; }

.header-actions button { background: #6B3E1E; }

nav {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  background: var(--accent);
  color: var(--muted);
  border: 1px solid transparent;
  padding: 12px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
  border-radius: 10px;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.section-header {
  margin-bottom: 24px;
}

.card-row {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.hr-register-card {
  padding: 18px 18px 14px;
}

.scm-register-card {
  padding: 18px 18px 14px;
}

.hr-register-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.scm-register-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.hr-register-btn {
  flex: 1;
  background: var(--accent);
  border: 1px solid transparent;
  color: var(--muted);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
}

.scm-register-btn {
  flex: 1;
  background: var(--accent);
  border: 1px solid transparent;
  color: var(--muted);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
}

.hr-register-btn.active {
  background: var(--primary);
  color: white;
}

.scm-register-btn.active {
  background: var(--primary);
  color: white;
}

.table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.table-scroll {
  overflow-x: auto;
  width: 100%;
  margin: 2px;
  padding: 0;
  border-spacing: 0;
}

.table-scroll table {
  width: 100%;
  min-width: 100%;
  border-spacing: 0;
}

.card,
.panel,
.table-form,
.hr-register-card,
.scm-register-card,
.pension-side-panel,
.pension-dashboard {
  margin: 2px;
}

.exit-table.table-1 .edit-btn,
.exit-table.table-1 .upload-btn,
.exit-table .view-attachments-btn {
  padding: 5px 8px;
  font-size: 0.75rem;
  min-width: auto;
  max-width: 100%;
  white-space: nowrap;
  border-radius: 8px;
}

.exit-table td button {
  display: inline-flex;
  justify-content: center;
  width: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: white;
}

.status-pill.approved {
  background: #006837;
}

.status-pill.rejected {
  background: #6B3E1E;
}

.status-pill.pending {
  background: #FFA500;
}

.hr-register-table,
  .exit-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 100%;
    font-family: var(--font);
    font-size: 0.82rem;
  }

  .hr-register-table th,
  .hr-register-table td,
  .exit-table th,
  .exit-table td {
    padding: 4px 6px;
    border: 1px solid #d9e2ef;
    text-align: left;
    background: white;
    font-size: 0.82rem;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

.hr-register-table th,
.exit-table th {
  background: var(--primary);
  color: #fff;
}

.hr-register-table tbody tr:nth-child(even) {
  background: #f5f8ff;
}

.hr-register-panel {
  width: 100%;
}

.table-form {
  border: 1px solid var(--border);
  background: #f7f1e6;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}

.table-form h4 {
  margin-top: 0;
  margin-bottom: 18px;
}

.table-form .form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.table-form .form-column {
  display: grid;
  gap: 16px;
}

.table-form .field-group {
  display: grid;
  gap: 8px;
}

.table-form .field-group label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.table-form input,
.table-form select,
.table-form textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
}

.table-form textarea {
  min-height: 80px;
  resize: vertical;
}

.table-form .remarks-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.table-form .field-group.full-width {
  grid-column: 1 / -1;
}

.pension-dashboard {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 20px;
  margin-top: 18px;
}

.pension-side-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

.pension-nav-btn {
  width: 100%;
  background: var(--accent);
  color: var(--muted);
  border: 1px solid transparent;
  padding: 6px 8px;
  font-size: 0.82rem;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.pension-nav-btn.active {
  background: var(--primary);
  color: white;
}

.pension-panel-content .pension-section {
  display: none;
}

.pension-panel-content .pension-section .card {
  min-height: 360px;
}

.pension-panel-content .pension-section.active {
  display: block;
}

@media (max-width: 900px) {
  .pension-dashboard {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}

.card h3 { margin-top: 0; }

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid label {
  font-weight: 600;
}

.field-with-icon {
  position: relative;
}

.field-with-icon input {
  width: 100%;
  padding-right: 52px;
}

.icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  padding: 6px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

textarea { min-height: 84px; resize: vertical; }

.history-block {
  margin-top: 22px;
}

.record-columns {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.record-card {
  border: 1px solid var(--border);
  background: #f8fbff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.record-card strong { display: block; margin-bottom: 6px; }

.task-card,
.supplier-card,
.base-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: #f8fbff;
  margin-bottom: 16px;
}

.task-card button,
.supplier-card button {
  width: auto;
  margin-top: 10px;
}

.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #d9e7ff;
  color: #1f4f8a;
}
.usage-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #f7f2d7;
  color: #705a19;
  margin-left: 8px;
}
.usage-pill.usage-green { background: #ddf0d8; color: #206a2f; }
.usage-pill.usage-amber { background: #fff1c5; color: #7a5c00; }
.usage-pill.usage-red { background: #fddede; color: #a22b2b; }

.status-pill.approved { background: #ddf0d8; color: #206a2f; }
.status-pill.rejected { background: #fddede; color: #a22b2b; }
.status-pill.pending { background: #fff1c5; color: #7a5c00; }

.notification {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1100;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(32, 106, 47, 0.95);
  color: #f5f7f4;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.notification.visible {
  opacity: 1;
  transform: translateY(0);
}
.notification.success { background: rgba(32, 106, 47, 0.95); }
.notification.error { background: rgba(155, 44, 44, 0.95); }
.notification.info { background: rgba(18, 72, 138, 0.92); }

body.staff #hr-dashboard-wrapper {
  display: none !important;
}

body.staff #hr-dashboard {
  display: block;
}


.error {
  color: #b93838;
  font-weight: 600;
}

.email-preview {
  margin-top: 18px;
  background: #07a060;
  border: 1px solid #c9ddf4;
  border-radius: 14px;
  padding: 16px;
  white-space: pre-wrap;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 31, 56, 0.55);
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal-content {
  width: min(900px, calc(100% - 40px));
  background: white;
  border-radius: 20px;
  padding: 24px;
  position: relative;
  max-height: 90vh;
  overflow: auto;
}

.modal-content .field-group {
  display: grid;
  gap: 10px;
}

.modal-content .field-group label {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.exit-date-input {
  width: 100%;
  min-width: 90px;
  padding: 8px 10px;
  background-color: #f4fff5;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
}

.exit-date-input::-moz-focus-inner {
  border: 0;
}

.exit-date-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  color: var(--primary);
  text-decoration: underline;
}

.exit-date-cell:hover {
  color: #00509d;
}

/* Larger, more tappable calendar placeholder for empty date cells */
.date-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f0f8ff;
  border: 1px solid #d9e2ef;
  color: #006837;
  line-height: 1;
}

.exit-text-input {
  width: 100%;
  padding: 8px 10px;
  background-color: #f4fff5;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
}
.exit-date-input:disabled,
.exit-text-input:disabled,
.exit-remarks-input:disabled,
.exit-pcm-status:disabled,
.exit-action-select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.exit-date-input::-moz-focus-inner {
  border: 0;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: none;
  background: red;
  font-size: 26px;
  cursor: pointer;
}

@media(max-width: 720px) {
  .header-actions,
  .record-columns,
  .card-row,
  nav { flex-direction: column; }
}

/* Exit Management Styles */
.exit-form-card {
  background: #f0f8ff;
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 30px;
  display: block !important;
  visibility: visible !important;
}

.exit-form-card h4 {
  margin-top: 0;
  color: var(--primary);
}

.exit-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 100%;
  font-size: 0.82rem;
}

.exit-table thead {
  background: var(--primary);
  color: white;
  position: sticky;
  top: 0;
}

.exit-table th,
.exit-table td {
  padding: 4px 6px;
  border: 1px solid #d9e2ef;
  text-align: left;
  background: white;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.exit-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.exit-table tbody tr:nth-child(even) {
  background: #f5f8ff;
}

.exit-table tbody tr:hover {
  background: #f0f8ff;
}

/* Network Days Conditional Formatting */
.network-days-green {
  background-color: #90EE90 !important;
  font-weight: 600;
  color: #1a5c1a;
}

.network-days-amber {
  background-color: #FFB347 !important;
  font-weight: 600;
  color: #663300;
}

.network-days-red {
  background-color: #FF6B6B !important;
  font-weight: 600;
  color: white;
}

/* Exit Management Table Grouping - 3D Appearance and Borders */
#exit-management-tab h4 {
  margin-top: 32px;
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: #006837;
  border-bottom: 3px solid #006837;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#exit-management-tab h4:first-of-type {
  margin-top: 16px;
}

/* Group Tables 1, 2, 3 together with unified styling */
.table-1-container,
.table-2-container,
.table-3-container {
  position: relative;
}

/* Adjust table-scroll styling for grouped appearance */
#exit-management-tab .table-scroll:has(.table-1),
#exit-management-tab .table-scroll:has(.table-2),
#exit-management-tab .table-scroll:has(.table-3) {
  border: 2px solid #0066cc;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 102, 204, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  background: white;
  overflow: hidden;
}

/* Add connecting lines between tables */
#exit-management-tab h4:nth-of-type(2) {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed #0066cc;
}

#exit-management-tab h4:nth-of-type(3) {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed #0066cc;
}

/* 3D Effect for exit table */
.exit-table {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafb 100%);
}

.exit-table thead {
  background: linear-gradient(180deg, #006837 0%, #004d2a 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exit-table th {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.exit-table tbody tr {
  border-bottom: 1px solid #d9e2ef;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.exit-table tbody tr:hover {
  background: linear-gradient(90deg, #e6f2ff 0%, #f0f8ff 100%);
  box-shadow: inset 0 1px 3px rgba(0, 102, 204, 0.1);
}

.exit-table tbody tr:nth-child(even) {
  background: linear-gradient(90deg, #f8f9fb 0%, #f5f8ff 100%);
}

/* Better visibility of connected tables */
.table-scroll:has(.table-1) {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.table-scroll:has(.table-2) {
  border-radius: 0;
}

.table-scroll:has(.table-3) {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  margin-bottom: 24px;
}


/* Upload Sections */
.upload-section {
  margin-bottom: 16px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.upload-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.upload-section input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 6px;
  cursor: pointer;
}

.upload-section input[type="file"]:hover {
  border-color: var(--primary);
}

.table-scroll {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin-bottom: 20px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-sizing: border-box;
}

.table-scroll table,
.table-scroll .exit-table,
.exit-table {
  display: table;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
  border-spacing: 0;
}

.exit-management-shortcut {
  margin-bottom: 18px;
}

.exit-management-shortcut button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.exit-management-shortcut button:hover {
  background: #00532f;
}

.exit-doc-list {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

.exit-doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: white;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}

.exit-doc-item button {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.exit-doc-item button:hover {
  background: #ff5252;
}

/* Notification badge */
.badge {
  display: inline-block;
  background: #ff3b30;
  color: white;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Adjust table header font: increase previous reduction by 3px (now -3px) */
table th,
.hr-register-table th,
.exit-table th {
  /* start with 0.82rem baseline reduced by 3px as requested, increased by 10% */
  font-size: calc(0.902rem - 3px) !important;
  line-height: 1.1;
}
/* ===== AWARD STATISTICS STYLES ===== */

/* Award Badge with Color Coding */
.award-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
}

.award-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Award Color Indicators */
.award-green {
  background-color: #ddf0d8;
  color: #206a2f;
  border: 1px solid #90ee90;
}

.award-amber {
  background-color: #fff1c5;
  color: #7a5c00;
  border: 1px solid #ffc107;
}

.award-red {
  background-color: #fddede;
  color: #a22b2b;
  border: 1px solid #ff6b6b;
}

.award-none {
  background-color: #e9ecef;
  color: #495057;
  border: 1px solid #dee2e6;
}

.award-count {
  font-size: 1.2rem;
  font-weight: 700;
}

.award-status {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* RFQ Award Statistics */
.rfq-award-stats {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
  border-radius: 10px;
  border-left: 4px solid #006837;
  border: 1px solid #dee2e6;
}

.award-stats-summary {
  background: white;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.award-stats-summary h4 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: #006837;
  border-bottom: 2px solid #006837;
  padding-bottom: 8px;
}

.award-stats-summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.award-stats-summary li {
  padding: 8px;
  margin-bottom: 8px;
  background: #f9f9f9;
  border-left: 3px solid #FFA500;
  border-radius: 4px;
  font-size: 0.9rem;
}

.award-stats-summary li strong {
  color: #006837;
}

.award-stats-total {
  background: linear-gradient(135deg, #006837 0%, #004d2a 100%);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: center;
}

.rfq-summary {
  margin-top: 12px;
  padding: 10px 14px;
  background: #f0f8ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  color: #1f4f8a;
  font-weight: 500;
}
/* ===== EMAIL SYSTEM STYLES ===== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal:not(.hidden) {
  display: flex;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 12px;
}

.modal-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 1.3rem;
}

.email-modal {
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-body {
  padding: 12px 0;
}

.email-recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: #f0f8ff;
  border-radius: 8px;
  border: 1px solid #b3d9ff;
  min-height: 40px;
}

.email-recipient-chip {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.email-history-container {
  display: grid;
  gap: 16px;
}

.email-history-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fafbff;
  transition: all 0.3s ease;
}

.email-history-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 104, 55, 0.1);
}

.email-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.email-history-header strong {
  color: var(--primary);
  font-size: 1rem;
}

.email-date {
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
}

.email-type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.email-type-badge.rfq {
  background: #FFB347;
  color: #663300;
}

.email-history-details {
  background: white;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent);
}

.email-history-details p {
  margin: 6px 0;
  font-size: 0.9rem;
}

.email-history-details strong {
  color: var(--primary);
}

.email-history-item details {
  margin-top: 12px;
}

.email-history-item summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  padding: 8px;
  background: #f0f8ff;
  border-radius: 6px;
  user-select: none;
}

.email-history-item summary:hover {
  background: #e6f2ff;
}

.email-history-item details p {
  margin-top: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 6px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  border-left: 3px solid var(--accent);
}

/* ===== ATTACHMENT AND RESPONSE COUNT STYLES ===== */

.attachment-preview {
  display: grid;
  gap: 8px;
}

.attachment-preview p {
  margin: 0;
  padding: 8px;
  background: #f0f8ff;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 0.9rem;
  color: #333;
}

.attachment-preview strong {
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.response-count-clickable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 6px 12px;
  background: #fff3cd;
  color: #7a5c00;
  border: 2px solid #ffc107;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.response-count-clickable:hover {
  background: #ffc107;
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.response-count-clickable:active {
  transform: scale(0.95);
}
