/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.admin-nav, .user-info {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.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-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* Form Styles */
.login-form {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-form h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus, 
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.form-row .form-group {
    flex: 1;
}

.admin-link {
    text-align: center;
    margin-top: 20px;
}

.admin-link a {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

.admin-link a:hover {
    text-decoration: underline;
}

/* Alert Messages */
.success, .error {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.order-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-date {
    color: #666;
    font-size: 14px;
}

.order-summary {
    color: #666;
    font-size: 14px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-item, .product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.product-item:hover, .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.product-image {
/*    width: 100%; */
    height: 350px;
    overflow: hidden;
    background-color: #f8f9fa;
    text-align: center;
}

.product-image img {
/*    width: 100%; */
    height: 350px; 
    object-fit: cover;
}

.product-info {
    padding: 20px;
	text-align: center;
}

.product-info h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.product-status, .product-created {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.product-id {
    color: #A9A9A9;
    font-size: 14px;
    margin-bottom: 0px;
    text-align: left;
}

.product-actions {
    padding: 15px 20px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-card.inactive {
    opacity: 0.6;
}

.product-card.highlight {
    background-color: #e0f8e9;   /* helles Grün */
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background-color: #f8f9fa;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

/* Order Form */
.order-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

/* Tables */




.orders-table-container, .locations-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.orders-table, .locations-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th, .orders-table td,
.locations-table th, .locations-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.orders-table th, .locations-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 1;
}


.orders-table th, .locations-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}


.orders-table tr:hover, .locations-table tr:hover {
    background-color: #f8f9fa;
}

.orders-table tr.inactive, .locations-table tr.inactive {
    opacity: 0.6;
}

.order-items-table  {
  border: 1px solid #777;
  border-collapse: collapse;
}
.order-items-table th, .order-items-table td {
  font-size: 12px;
  border: 1px solid #777;

  padding-top: 1px;    /* Abstand oben */
  padding-right: 1px;  /* Abstand rechts */
  padding-bottom: 1px; /* Abstand unten */
  padding-left: 4px;   /* Abstand links */
  margin: 0;             
  border-spacing: 0;  
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #2c3e50;
}

.actions {
    display: flex;
    gap: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
}

/* Settings Form */
.settings-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settings-group {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.settings-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-group h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.settings-note {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    font-style: italic;
}

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

    .header {
        flex-direction: column;
        text-align: center;
    }

    .admin-nav, .user-info {
        margin-top: 15px;
    }

    .form-row {
        flex-direction: column;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .actions {
        justify-content: center;
    }

    .orders-table-container, .locations-table-container {
        overflow-x: auto;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .product-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-form {
        margin: 50px auto;
        padding: 30px 20px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .admin-nav .btn, .user-info .btn {
        width: auto;
        margin-bottom: 5px;
    }
}

/* === Zusätzliche Styles für „Ausreichend“-Button und Kachel-Highlight === */

/* Standard-Grau für „Ausreichend“-Button */
.btn-sufficient {
  background-color: #95a5a6;
  color: white;
  transition: background-color 0.3s ease;
}

/* Hover-Effekt */
.btn-sufficient:hover {
  background-color: #7f8c8d;
}

/* Aktiver Zustand = Grün */
.btn-sufficient-active {
  background-color: #27ae60 !important;
  color: white !important;
}

/* Kachel grün markieren */
.product-card.highlight_order {
  border: 2px solid #2980b9;
  background-color:  #cce6ff;
}

/* Kachel grau markieren */
.product-card.highlight_sufficient {
  border: 2px solid #27ae60;
  background-color: #e8f5e8;
}


/* Text- und Button-Hintergrund innerhalb der grün markierten Kachel */
.product-card.highlight .product-info,
.product-card.highlight .product-actions {
  background-color: #e8f5e8;
}