/* MUI-inspired Blue Theme */
:root {
  --primary-main: #0056ab;
  --primary-dark: #002b5d;
  --primary-light: #2a6494;
  --secondary-main: #dc004e;
  --secondary-dark: #9a0036;
  --secondary-light: #ff5983;
  --success-main: #2e7d32;
  --warning-main: #ed6c02;
  --error-main: #d32f2f;
  --info-main: #00649a;
  --text-primary: #1a2027;
  --text-secondary: #656565;
  --background-default: #f5f5f5;
  --background-paper: #ffffff;
  --grey-50: #fafafa;
  --grey-100: #f5f5f5;
  --grey-200: #eeeeee;
  --grey-300: #e0e0e0;
  --grey-400: #bdbdbd;
  --grey-500: #9e9e9e;
  --border-radius: 8px;
  --shadow-1: 0 1px 10px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  --shadow-3: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Roboto", "Segoe UI", sans-serif;
}

body {
  background: var(--background-default);
  min-height: 100vh;
  animation: fadeIn 0.8s ease-in-out;
  font-family: "Roboto", Arial, sans-serif;
  color: var(--text-primary);
}

/* MUI Container */
.container {
  background: var(--background-paper);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-1);
  padding: 24px;
  animation: slideUp 0.7s ease-in-out;
  overflow: hidden;
}

/* MUI Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-main), var(--primary-dark));
  color: white;
  padding: 16px 24px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
}

.logo {
  height: 48px;
  width: auto;
}

.title {
  flex-grow: 1;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 500;
  color: white;
  letter-spacing: 0.25px;
}

.btn-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-group div a button,
.logout {
  padding: 8px 16px;
  background: #336699;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--transition);
  text-transform: none;
  letter-spacing: 0.25px;
  width: 100%;
}

.btn-group a button:hover {
  background: #1e3c5a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logout {
  background: #ffffff3d;
}

/* MUI Stats Section */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
  font-weight: bold;
}

.stat-box {
  flex: 0 0 auto;
  border: 2px solid #c0bdbdff;
  padding: 10px;
  background-color: #004080;
  color: white;
  border-radius: 10px;
  width: 20%;
  text-align: center;
  font-weight: bold;
  transition: transform 0.3s ease;
}

.stat-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* MUI Table */
.table-container {
  background: var(--background-paper);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  margin-top: 24px;
  border: 1px solid var(--grey-200);
  width: 100%;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background-paper);
}

.table-container th {
  background: #004080;
  color: white;
  padding: 14px 12px;
  text-align: justify;
  font-weight: 500;
  font-size: 0.875rem;
  border-bottom: 1px solid #ddd;
}

.table-container td {
  padding: 12px;
  border-bottom: 1px solid var(--grey-200);
  transition: var(--transition);
  font-size: 0.875rem;
}

.table-container tbody tr {
  transition: var(--transition);
}

.table-container tbody td {
  background-color: #ffffff;
  padding: 10px;
  border: 1px solid #ddd;
  text-align: justify;
  width: max-content;
}

.table-container tbody tr:hover {
  background-color: #f1f1f1;
}

.table-container tbody tr:last-child td {
  border-bottom: none;
}
.clickable-row:hover {
  background-color: #f5f5f5;
  transition: background-color 0.2s ease;
}

.clickable-row td {
  transition: background-color 0.2s ease;
}

/* MUI Status Chips */
.status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  min-width: 70px;
  text-align: center;
}

/* .status.pending {
  background: #fff3e0;
  color: #ffc107;
  border: 1px solid #ffb74d;
}

.status.approved {
  background: #e8f5e8;
  color: #28a745;
  border: 1px solid #81c784;
}

.status.rejected {
  background: #ffebee;
  color: #dc3545;
  border: 1px solid #e57373;
} */

.status.notsent,
.status.notapplicable {
  background: var(--grey-100);
  color: var(--grey-600);
  border: 1px solid var(--grey-300);
}

/* MUI Action Buttons */
.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-edit {
  background-color: #17a2b8;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(25, 118, 210, 0.3);
}

.btn-edit:hover {
  background: #138496;
  box-shadow: 0 2px 6px rgba(25, 118, 210, 0.4);
  transform: translateY(-1px);
}

.btn-view {
  background: #6c757d;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-view:hover {
  background: var(--grey-600);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-timeline {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.btn-timeline:hover {
  background-color: #0056b3;
}

/* MUI Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-3);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--grey-200);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

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

.close {
  color: white;
  float: right;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  background-color: #f51027;
  transition: background-color 0.3s ease;
  line-height: 1;
  border: none;
  padding: 8px;
  border-radius: 15%;
}

.close:hover {
  background-color: #c82333;
  color: white;
}

/* Info Section */
.info-section {
  background: var(--background-paper);
  padding: 20px 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
  border: 1px solid var(--grey-200);
}

.info-row {
  display: flex;
  flex-direction: column;
  align-items: start;
  flex-wrap: wrap;
  gap: 16px;
}

.info-row div {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 400;
}

.info-row div strong {
  color: var(--primary-main);
  font-weight: 500;
}

/* MUI Typography Scale */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    margin: 16px;
    padding: 16px;
  }

  .header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 16px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .info-row {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .btn-group {
    flex-wrap: wrap;
    justify-content: center;
  }

  .table-container {
    overflow-x: auto;
    font-size: 0.8rem;
  }

  .modal-content {
    margin: 5% auto;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 8px;
    padding: 12px;
  }

  .header {
    padding: 12px;
  }

  .title {
    font-size: 1.125rem;
  }

  .btn-group a button {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

.timeline-container {
  position: relative;
  padding: 30px 20px;
  background: #ffffff;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  text-align: left;
  margin-bottom: 20px;
  position: static;
}

.timeline-header h3 {
  color: #2c3e50;
  margin-bottom: 5px;
  font-size: 20px;
  font-weight: 600;
}

.timeline-subtitle {
  color: #7f8c8d;
  font-size: 14px;
}

.voucher-info {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 40px;
  border: 1px solid #e9ecef;
}

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

.voucher-info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.voucher-info-item strong {
  color: #495057;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

button.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  animation: buttonSpin 0.7s linear infinite;
}

@keyframes buttonSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.voucher-info-item span {
  color: #2c3e50;
  font-size: 14px;
  font-weight: 500;
}

/* Horizontal Timeline */
.timeline-horizontal {
  position: relative;
  padding: 60px 20px 40px 20px;
  overflow-x: auto;
  overflow-y: visible;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

.timeline-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  padding: 0 60px;
}

/* Progress Line Background */
.timeline-track::before {
  content: "";
  position: absolute;
  top: 50px;
  left: 60px;
  right: 60px;
  height: 6px;
  background: #e9ecef;
  z-index: 0;
  border-radius: 3px;
}

/* Animated Progress Line */
.timeline-progress {
  position: absolute;

  top: 50px;
  left: 60px;
  height: 6px;
  background: linear-gradient(
    90deg,
    #10b981de 0%,
    #10b9816c 50%,
    #00724c69 100%
  );
  z-index: 1;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Timeline Stage Container */
.timeline-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  z-index: 2;
}

/* Timeline Stage Dot */
.timeline-stage-dot {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 4px solid #e9ecef;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.timeline-stage-dot:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.timeline-stage-dot.approved {
  background: linear-gradient(135deg, #12d292ff 0%, #06c287ff 100%);
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.timeline-stage-dot.pending {
  background: linear-gradient(135deg, #abaaaaff 0%, #ebebebff 100%);
  border-color: #7e7e7eff;
  box-shadow: 0 4px 12px rgba(124, 123, 120, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
  }

  50% {
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.6);
  }
}

.timeline-stage-dot.rejected {
  background: linear-gradient(135deg, #f06a6aff 0%, #ff6161ff 100%);
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.timeline-stage-dot.notapplicable {
  background: #f3f4f6;
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Icons inside dots */
/* .timeline-stage-dot.approved::after {
            content: '✓';
            color: white;
            font-size: 30px;
            font-weight: bold;
        }

        .timeline-stage-dot.pending::after {
            content: '○';
            color: white;
            font-size: 28px;
            font-weight: bold;
        }

        .timeline-stage-dot.rejected::after {
            content: '✕';
            color: white;
            font-size: 28px;
            font-weight: bold;
        }

        .timeline-stage-dot.notapplicable::after {
            content: '—';
            color: #9ca3af;
            font-size: 24px;
            font-weight: bold;
        }
 */
/* Stage Info */
.timeline-stage-info {
  margin-top: 25px;
  text-align: center;
  max-width: 140px;
}

.timeline-stage-date {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.timeline-stage-date.approved {
  color: #10b981;
}

.timeline-stage-date.pending {
  color: #f59e0b;
}

.timeline-stage-date.rejected {
  color: #ef4444;
}

.timeline-stage-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.3;
}

.timeline-stage-status {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.timeline-stage-status.approved {
  background: #d1fae5;
  color: #065f46;
}

.timeline-stage-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.timeline-stage-status.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.timeline-stage-status.notapplicable {
  background: #f3f4f6;
  color: #6b7280;
}

.timeline-stage-timestamp {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 6px;
  font-weight: 500;
}

.timeline-stage-by {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
}

/* Remarks Section */
.timeline-remarks-section {
  margin-top: 40px;
  padding: 20px;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
}

.timeline-remarks-section h4 {
  color: #92400e;
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: 600;
}

.timeline-remarks-section p {
  color: #78350f;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

/* Duration Display */
.timeline-duration-wrapper {
  text-align: center;
  margin-top: 30px;
}

.timeline-duration {
  display: inline-block;
  padding: 15px 30px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  border: 2px solid #bae6fd;
}

.timeline-duration-label {
  font-size: 12px;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.timeline-duration-value {
  font-size: 28px;
  font-weight: 700;
  color: #0c4a6e;
  margin-top: 5px;
}

@keyframes progressAnimation {
  from {
    width: 0;
  }
}

.timeline-progress {
  animation: progressAnimation 1.5s ease-out;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .timeline-track {
    min-width: 750px;
    padding: 0 40px;
  }

  .timeline-track::before {
    left: 40px;
    right: 40px;
  }

  .timeline-progress {
    left: 40px;
  }

  .timeline-stage-dot {
    width: 50px;
    height: 50px;
  }

  .timeline-stage-info {
    max-width: 120px;
  }
}

@media (max-width: 768px) {
  .timeline-horizontal {
    padding: 30px 10px;
  }

  .timeline-track {
    flex-direction: column;
    align-items: flex-start;
    min-width: auto;
    padding: 0 20px;
  }

  .timeline-track::before {
    top: 25px;
    left: 25px;
    right: auto;
    bottom: 25px;
    width: 6px;
    height: auto;
  }

  .timeline-progress {
    top: 25px;
    left: 25px;
    width: 6px !important;
    height: auto;
  }

  .timeline-stage {
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin-bottom: 35px;
  }

  .timeline-stage-dot {
    flex-shrink: 0;
  }

  .timeline-stage-info {
    margin-top: 0;
    margin-left: 20px;
    text-align: left;
    max-width: none;
  }
}

.overall-status-approved {
  background-color: #d4edda;
  color: #155724;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
}

.overall-status-pending {
  background-color: #fff3cd;
  color: #856404;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
}

.overall-status-rejected {
  background-color: #f8d7da;
  color: #721c24;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
}

.filter-tabs {
  display: flex;
  gap: 30px;
  margin: 20px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 12px 24px;
  border: 2px solid #004080;
  background-color: #ffffff;
  color: #004080;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  font-size: 14px;
}

.filter-tab:hover {
  background-color: #f0f0f0;
}

.filter-tab.active {
  background-color: #004080;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 64, 128, 0.3);
}

.filter-tab .count {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  font-size: 12px;
}

.filter-tab.active .count {
  background-color: rgba(255, 255, 255, 0.2);
}

.no-vouchers {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

.no-vouchers i {
  font-size: 48px;
  color: #ccc;
  margin-bottom: 5px;
}

.voucher-info-item span {
  color: #2c3e50;
  font-size: 15px;
  font-weight: 600;
  background: white;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 25px 0;
}

.pagination span,
.pagination input {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
}

.pagination .active {
  background: #004080;
  color: white;
  border-color: #004080;
}

.pagination input {
  width: 70px;
  text-align: center;
}

@media print {
  .close,
  .btn-edit,
  .btn-view,
  .btn-timeline,
  .filter-tabs {
    display: none !important;
  }

  .modal-content {
    margin: 0;
    padding: 20px;
    box-shadow: none;
  }

  .timeline-stage-dot {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

@media (max-width: 768px) {
  .modal-content {
    margin: 2% auto;
    max-width: 95%;
    padding: 15px;
  }

  .timeline-header h2 {
    font-size: 16px !important;
  }

  .voucher-info-grid {
    grid-template-columns: 1fr !important;
  }

  .timeline-duration-value {
    font-size: 20px !important;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn-timeline,
  .btn-view,
  .btn-edit {
    width: 100%;
    text-align: center;
  }
}

/* Focus States for Accessibility */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-main);
  outline-offset: 2px;
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--grey-100);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-main);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
