:root {
  --industrial-gray: #e9ecef;
  --border-gray: #dee2e6;
  --table-bg: #ffffff;
  --header-bg: #495057;
  --text-dark: #212529;
  --text-medium: #6c757d;
  --highlight-yellow: #b8860b;
  --highlight-red: #dc3545;
  --highlight-green: #28a745;
  --button-blue: #007bff;
  --button-gray: #6c757d;
  --erledigt-bg: #f0f9f0;
  --archive-bg: #f8f9fa;
  --archive-border: #dee2e6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8f9fa;
  color: var(--text-dark);
  line-height: 1.5;
  padding: 0;
  min-height: 100vh;
}

/* Layout Container */
.main-container {
  max-width: 98vw;
  margin: 0 auto;
  padding: 15px 10px;
}

/* Header Principal */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px solid #adb5bd;
}

.page-title {
  text-align: center;
  /* width: 100%; --> pentru centrarea titlului */
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 15px 0 7px;
  color: #2c3e50;
}

.page-title span {
  font-weight: 400;
  color: #555;
}

.header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.machine-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.machine-tab {
  padding: 6px 14px;
  border: 1px solid var(--border-gray);
  background: white;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  color: var(--text-dark);
}

.machine-tab.active {
  background: var(--button-blue);
  color: white;
  border-color: var(--button-blue);
}

.machine-tab:hover {
  background: #f1f3f5;
}

/* Sectiunea Aktuelle Aufgaben */
.active-section {
  margin-bottom: 30px;
}

.active-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-gray);
}

.active-title {
  color: var(--text-dark);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Buton inline „(+ Neuer Eintrag)” */
.btn-new-entry-inline {
  background: none;
  border: none;
  padding: 0;
  margin-left: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--button-blue);
  cursor: pointer;
}

.btn-new-entry-inline:hover {
  text-decoration: underline;
}

/* Buton pentru Arhiva */
.btn-show-archive {
  background-color: transparent;
  color: var(--text-medium);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-show-archive:hover {
  background-color: #f1f3f5;
  color: var(--text-dark);
}

.archive-icon {
  font-size: 16px;
}

/* Table Wrapper */
.table-wrapper {
  background: var(--table-bg);
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow-x: auto;
}

/* Sectiunea Arhiva */
.archive-section {
  margin-top: 30px;
  display: none;
}

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--archive-border);
}

.archive-title {
  color: var(--text-medium);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.archive-subtitle {
  font-size: 14px;
  color: #868e96;
  font-weight: normal;
  margin-left: 10px;
}

.archive-count {
  color: #6c757d;
  font-size: 13px;
}

.archive-wrapper {
  background: var(--archive-bg);
  border: 1px solid var(--archive-border);
  border-radius: 4px;
  overflow-x: auto;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
}

.archive-table thead {
  background-color: #6c757d;
}

.archive-table th {
  color: white;
  font-weight: 500;
  text-align: center;
  padding: 12px 8px;
  border-right: 1px solid #7a8289;
  position: relative;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.archive-table th:last-child {
  border-right: none;
}

.archive-table th:hover {
  background-color: #5a6268;
}

.archive-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--archive-border);
  border-right: 1px solid var(--archive-border);
  vertical-align: middle;
  font-size: 13px;
  color: #666;
}

.archive-table td:last-child {
  border-right: none;
}

.archive-table tbody tr:hover {
  background-color: #f1f3f5;
}

/* Coloane specifice */
.main-table th:nth-child(1), 
.main-table td:nth-child(1),
.archive-table th:nth-child(1),
.archive-table td:nth-child(1) {
  width: 85px;
  min-width: 85px;
}

.main-table th:nth-child(4), 
.main-table td:nth-child(4),
.archive-table th:nth-child(4),
.archive-table td:nth-child(4) {
  width: 85px;
  min-width: 85px;
}

.main-table th:nth-child(7), 
.main-table td:nth-child(7),
.archive-table th:nth-child(7),
.archive-table td:nth-child(7) {
  width: 110px;
  min-width: 110px;
}

.main-table th:nth-child(8), 
.main-table td:nth-child(8) {
  width: 160px;
  min-width: 160px;
}

.archive-table th:nth-child(8),
.archive-table td:nth-child(8) {
  width: 100px;
  min-width: 100px;
}

/* Celule centrate */
.main-table td:nth-child(1),
.main-table td:nth-child(4),
.main-table td:nth-child(7),
.archive-table td:nth-child(1),
.archive-table td:nth-child(4),
.archive-table td:nth-child(7) {
  text-align: center;
}

/* Tabel principal */
.main-table {
  width: 100%;
  border-collapse: collapse;
}

.main-table thead {
  background-color: var(--header-bg);
}

.main-table th {
  color: white;
  font-weight: 500;
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid #5a6268;
  position: relative;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.main-table th:last-child {
  border-right: none;
}

.main-table th:hover {
  background-color: #3d4348;
}

.sort-indicator {
  margin-left: 4px;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}

.main-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-gray);
  border-right: 1px solid var(--border-gray);
  vertical-align: middle;
  font-size: 14px;
  color: #333;
}

.main-table td:last-child {
  border-right: none;
}

.main-table tbody tr:hover {
  background-color: #f1f3f5;
}

/* Stiluri STATUS */
.status-cell {
  font-weight: 600;
  font-size: 13px;
}

.status-cell.status-neu { color: var(--highlight-yellow); }
.status-cell.status-abgebrochen { color: var(--highlight-red); }
.status-cell.status-erledigt { 
  color: var(--highlight-green);
  cursor: help;
  position: relative;
}
.status-cell.status-gelesen { color: var(--text-medium); }
.status-cell.status-in-arbeit { color: var(--button-blue); }

/* Stiluri Prioritate */
.priority-cell.prio-hoch {
  color: var(--highlight-red);
  font-weight: 700;
}

.priority-cell.prio-mittel {
  color: var(--text-dark);
  font-weight: 600;
}

.priority-cell.prio-niedrig {
  color: var(--text-medium);
  font-weight: 600;
}

/* Randuri completate */
tr.erledigt-row,
tr.abgebrochen-row {
  background-color: var(--erledigt-bg);
}

tr.abgebrochen-row td:nth-child(-n+6) {
  text-decoration: line-through;
  color: #6c757d;
}

/* Tooltip pentru Erledigt */
.erledigt-tooltip {
  position: absolute;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: normal;
  white-space: nowrap;
  z-index: 1000;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease, visibility 0.1s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.erledigt-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.status-cell.status-erledigt:hover .erledigt-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Butoane acțiune */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.action-btn {
  padding: 4px 8px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}

.action-btn:hover { background-color: #f0f0f0; }
.btn-bearbeiten { color: #333; }
.btn-gelesen { color: var(--button-blue); border-color: #b8daff; }
.btn-erledigt { color: var(--highlight-green); border-color: #c3e6cb; }
.btn-archivieren { 
  color: #6c757d; 
  border-color: #6c757d; 
  background-color: #f8f9fa;
}

/* Buton acțiune arhivă */
.archive-action-btn {
  padding: 4px 8px;
  border: 1px solid #ccc;
  background: white;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}

.btn-archive-delete {
  color: var(--highlight-red);
  border-color: var(--highlight-red);
}

.btn-archive-delete:hover {
  background-color: var(--highlight-red);
  color: white;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(0.6px);
}

.modal-container {
  background: white;
  padding: 25px;
  width: 100%;
  max-width: 500px;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-title {
  color: var(--text-dark);
  margin-bottom: 20px;
  font-size: 20px;
  border-bottom: 2px solid var(--industrial-gray);
  padding-bottom: 10px;
}

.form-group { margin-bottom: 15px; }
.form-label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; color: #555; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}
.form-textarea { min-height: 80px; resize: vertical; }

/* Footer modal */
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.right-actions {
  display: flex;
  gap: 10px;
}

.btn-modal-cancel {
  background: #f8f9fa;
  border: 1px solid #ddd;
  color: #333;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-modal-save {
  background: var(--button-blue);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.btn-modal-delete {
  background: white;
  color: var(--highlight-red);
  border: 1px solid var(--highlight-red);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-modal-delete:hover {
  background: var(--highlight-red);
  color: white;
}

/* Modal ștergere */
.delete-modal .modal-container {
  max-width: 400px;
  text-align: center;
}

.delete-modal .modal-title {
  border-bottom: none;
  color: var(--highlight-red);
  margin-bottom: 15px;
}

.delete-modal .modal-text {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.6;
}

.delete-modal .modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.btn-delete-cancel {
  background: #f8f9fa;
  border: 1px solid #ddd;
  color: #333;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-delete-confirm {
  background: var(--highlight-red);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

/* Modal arhivare */
.archive-modal .modal-container {
  max-width: 400px;
  text-align: center;
}

.archive-modal .modal-title {
  border-bottom: none;
  color: #6c757d;
  margin-bottom: 15px;
}

.archive-modal .modal-text {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.6;
}

.archive-modal .modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.btn-archive-cancel {
  background: #f8f9fa;
  border: 1px solid #ddd;
  color: #333;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-archive-confirm {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

/* Modal completare */
.completion-modal .modal-container {
  max-width: 400px;
}

/* Print Preview Styles */
.print-modal .modal-container {
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.print-preview-container {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.4;
}

.print-preview {
    max-width: 210mm; /* A4 */
    margin: 0 auto;
    padding: 20mm;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.print-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
}

.print-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.print-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.print-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.print-table th {
    background-color: #f2f2f2;
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-weight: bold;
    color: #333;
}

.print-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: top;
}

.print-priority-Hoch {
    color: #dc3545;
    font-weight: bold;
}

.print-priority-Mittel {
    color: #333;
    font-weight: 600;
}

.print-priority-Niedrig {
    color: #6c757d;
    font-weight: 600;
}

.print-status-Neu { color: #b8860b; }
.print-status-Gelesen { color: #6c757d; }
.print-status-In-Arbeit { color: #007bff; }
.print-status-Erledigt { color: #28a745; }
.print-status-Abgebrochen { color: #dc3545; }

.print-footer {
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-size: 10px;
    color: #666;
    text-align: center;
}

/* Hide elements in print */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-preview {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    body {
        margin: 0;
        padding: 0;
    }
}

.btn-print {
    background: transparent;
    color: var(--text-medium);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-print:hover {
    background-color: #f1f3f5;
    color: var(--text-dark);
}

/* pagina log-in */
.login-container {
  max-width: 320px;
  margin: 120px auto;
  padding: 24px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
}

.login-container input {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
}

.login-container button {
  width: 100%;
  padding: 8px;
}

.login-error {
  color: #c62828;
  margin-top: 8px;
  font-size: 13px;
}

/*abmelden */
#logoutBtn {
    display: inline-flex; /* Se ajustează după conținut */
    align-items: center;
    gap: 6px;
    background-color: rgba(68, 68, 68, 0.7); /* Semi-transparent */
    color: white;
    border: none;
    padding: 5px 10px; /* Mai mic */
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px; /* Text mai mic */
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

#logoutBtn:hover {
    background-color: #c0392b; /* Roșu la hover */
    opacity: 1;
    transform: scale(1.02);
}

#logoutBtn i {
    font-size: 11px; /* Iconița mică */
}

/*Footer */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #f5f7f8;
  color: #666;
  padding: 1.8px 0;
  text-align: center;
  font-size: 12px;
  z-index: 999;
  border-top: 0px solid #ddd;
}

.title-wrapper {
  display: flex;
  flex-direction: column;
}

.demo-subtitle {
  font-size: 15px;
  color: #999;
  margin-top: -5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-icon {
  cursor: pointer;
  font-size: 20px;
  color: #6c757d;
  transition: 0.2s;
}

.info-icon:hover {
  color: #007bff;
  transform: scale(1.1);
}

.demo-info-text {
  text-align: left;
  font-size: 14px;
  color: #444;
  line-height: 1.5;
}

.demo-info-text p {
  margin-bottom: 12px;
}

.demo-info-text strong {
  color: #222;
}