* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  user-select: none;
  /* Disable text selection */
  padding-bottom: 80px;
  /* Space for sticky footer */
}

/* Override user-select for inputs */
input,
textarea {
  user-select: text;
}

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  padding: 15px 40px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 900;
}

.search-container {
  margin: 0 auto 20px auto;
  max-width: 600px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 20px 12px 40px;
  /* Space for icon */
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.2);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #95a5a6;
}

/* Spinner for in-progress delete */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* Timeline Graph */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 24px;
}

.timeline-label {
  width: 100px;
  font-size: 0.85rem;
  color: #555;
  text-align: right;
  font-weight: 500;
}

.timeline-track {
  flex: 1;
  height: 20px;
  background-color: #e0e0e0;
  /* Grey for "No Data" / Gaps */
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.timeline-block {
  position: absolute;
  height: 100%;
  top: 0;
  transition: width 0.3s;
}

.block-up {
  background-color: #2ecc71;
  /* Green for Up */
  border-left: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
}

.block-suspect {
  background-color: #f1c40f;
  /* Yellow for Suspect */
}

.block-down {
  background-color: #e74c3c;
  /* Red for Down */
  z-index: 1;
}



.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.page-header h1 {
  margin: 0;
  font-size: 2em;
  color: #2c3e50;
}

.page-header p {
  margin: 5px 0 0;
  color: #7f8c8d;
}

header h1 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 2.5em;
}

header p {
  color: #7f8c8d;
  font-size: 1.1em;
}

.user-info {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-admin {
  background-color: #e74c3c;
  color: white;
}

.btn-admin:hover {
  background-color: #c0392b;
}

.btn-logout {
  background-color: #e67e22;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-logout:hover {
  background-color: #d35400;
}

.btn-refresh {
  background-color: #27ae60;
  color: white;
}

.btn-refresh:hover {
  background-color: #229954;
}

/* Download Section */
.download-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.download-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.download-buttons .btn {
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon {
  font-size: 1.2em;
}

/* Admin Section */
.admin-section {
  text-align: center;
  padding: 30px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Login Form */
.login-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-form {
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #2c3e50;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ecf0f1;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
}

.input-group {
  display: flex;
  gap: 10px;
}

.input-group input {
  flex: 1;
}

/* Machine Grid Enhancements */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#machineTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

#machineTable th,
#machineTable td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

#machineTable th {
  background: #f8f9fa;
  font-weight: 600;
  color: #5d6d7e;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

#machineTable tr:hover {
  background-color: #fcfcfc;
}

/* Column Widths */
.col-name {
  width: 30%;
}

.col-status {
  width: 15%;
}

.col-seen {
  width: 25%;
}

.col-actions {
  width: 15%;
}

.machine-name-cell {
  font-weight: 600;
  color: #2c3e50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status Circles */
.status-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.status-green {
  background-color: #2ecc71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.status-yellow {
  background-color: #f1c40f;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.4);
}

.status-red {
  background-color: #e74c3c;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

/* Responsive Text Hiding */
@media (max-width: 1200px) {
  .col-name {
    width: 35%;
  }

  .col-seen {
    width: 20%;
  }
}

@media (max-width: 1000px) {
  .status-label {
    display: none;
  }

  .col-status {
    width: 60px;
  }

  .status-wrapper {
    justify-content: center;
  }
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  width: 90%;
  max-width: 600px;
  overflow: hidden;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.hash-code {
  word-break: break-all;
  background: #f0f2f5;
  padding: 12px;
  border-radius: 6px;
  font-family: monospace;
}

.btn-remove {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
}

/* Live Status Badge */
.live-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-right: 1rem;
  font-weight: 500;
}

.last-updated {
  font-size: 0.8rem;
  color: #7f8c8d;
  margin-right: 1.5rem;
  font-style: italic;
}

.status-red {
  background: #fee2e2;
  color: #ef4444;
  border: 1px solid #fecaca;
}

.status-green {
  background: #dcfce7;
  color: #22c55e;
  border: 1px solid #bbf7d0;
}

.status-yellow {
  background: #fef9c3;
  color: #ca8a04;
  border: 1px solid #fef08a;
}

.removal-form-spacing {
  margin-top: 20px;
}

.warning-text {
  color: #e67e22;
  font-weight: 500;
  margin-top: 10px;
} 
 / *   T o a s t   N o t i f i c a t i o n s   * /  
 . t o a s t - c o n t a i n e r   {  
     p o s i t i o n :   f i x e d ;  
     t o p :   2 0 p x ;  
     r i g h t :   2 0 p x ;  
     z - i n d e x :   9 9 9 9 ;  
     d i s p l a y :   f l e x ;  
     f l e x - d i r e c t i o n :   c o l u m n ;  
     g a p :   1 0 p x ;  
 }  
  
 . t o a s t   {  
     p a d d i n g :   1 5 p x   2 5 p x ;  
     b a c k g r o u n d :   w h i t e ;  
     b o r d e r - r a d i u s :   8 p x ;  
     b o x - s h a d o w :   0   4 p x   1 5 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 2 ) ;  
     t r a n s f o r m :   t r a n s l a t e X ( 1 2 0 % ) ;  
     t r a n s i t i o n :   t r a n s f o r m   0 . 3 s   c u b i c - b e z i e r ( 0 . 6 8 ,   - 0 . 5 5 ,   0 . 2 6 5 ,   1 . 5 5 ) ;  
     f o n t - w e i g h t :   5 0 0 ;  
     m i n - w i d t h :   2 5 0 p x ;  
     d i s p l a y :   f l e x ;  
     a l i g n - i t e m s :   c e n t e r ;  
     g a p :   1 2 p x ;  
 }  
  
 . t o a s t . s h o w   {  
     t r a n s f o r m :   t r a n s l a t e X ( 0 ) ;  
 }  
  
 . t o a s t . s u c c e s s   {  
     b o r d e r - l e f t :   4 p x   s o l i d   # 2 e c c 7 1 ;  
 }  
  
 . t o a s t . e r r o r   {  
     b o r d e r - l e f t :   4 p x   s o l i d   # e 7 4 c 3 c ;  
 }  
  
 . t o a s t . i n f o   {  
     b o r d e r - l e f t :   4 p x   s o l i d   # 3 4 9 8 d b ;  
 }  
 