.admin-container { font-family: 'Poppins', sans-serif; background-color: #e6f0fa; color: #0c0c0c; padding: 40px 30px; min-height: 100vh; } .admin-container h2, .admin-container h3 { color: #0d3c78; margin-bottom: 20px; }
.admin-top { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:18px; flex-wrap:wrap; }
.admin-logout { background:#e6f4ff; padding:10px 14px; border-radius:8px; display:flex; gap:12px; align-items:center; }
.logout-btn { background:#b30000; color:#fff; padding:8px 12px; border-radius:6px; text-decoration:none; }
.admin-controls { display:flex; gap:12px; align-items:center; }
#admin-search { padding:8px 12px; border-radius:8px; border:1px solid #cde6ff; min-width:220px; }
.tabs { display:flex; gap:8px; }
.tab-btn { background:#fff; border:1px solid #cde6ff; padding:8px 12px; border-radius:8px; cursor:pointer; }
.tab-btn.active { background:#0d3c78; color:#fff; border-color:#0d3c78; }
#login-btn{  display: inline-block;
  padding: 10px 35px;
  background-color: #1a73e8;
  color: #ffffff;
  border-radius: 0px;
  -webkit-transition: all .3s;
  transition: all .3s;
  border: 1px solid #1a73e8;}
#login-btn:hover{  background-color: transparent;
  color: #1a73e8;}
.admin-tab { display:none; }
.admin-tab.active { display:block; }

.login { max-width:420px; margin:60px auto; background:#fff; padding:20px; border-radius:10px; box-shadow:0 6px 18px rgba(0,0,0,0.06); }
.login input { width:100%; padding:10px; margin-bottom:10px; border-radius:6px; border:1px solid #ddd; }

.create-form { background:#fff; padding:16px; border-radius:10px; box-shadow:0 6px 18px rgba(0,0,0,0.04); max-width:900px; }
.create-form input, .create-form textarea { width:100%; padding:8px; margin:6px 0 12px; border-radius:6px; border:1px solid #e4f0ff; }

.btn-primary { background:#0d3c78; color:#fff; padding:10px 14px; border-radius:8px; border:none; cursor:pointer; }

.admin-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); gap:18px; margin-top:12px; }
.admin-card { background:#fff; border-radius:10px; padding:12px; box-shadow:0 6px 18px rgba(0,0,0,0.04); display:flex; flex-direction:column; gap:10px; }
.card-top { display:flex; gap:12px; align-items:center; }
.card-thumb img { width:88px; height:88px; object-fit:cover; border-radius:8px; }
.placeholder { width:88px; height:88px; display:flex; align-items:center; justify-content:center; background:#f0f5fb; border-radius:8px; color:#6b7687; }
.card-meta h4 { margin:0; font-size:1rem; }
.card-meta .price { margin:4px 0 0; color:#0d3c78; font-weight:600; }
.card-actions { margin-left:auto; display:flex; gap:8px; align-items:center; }
.card-actions .toggle-edit, .card-actions .delete-btn { background:#fff; border:1px solid #e4f0ff; padding:6px 8px; border-radius:6px; cursor:pointer; }
.delete-btn { background:#b30000; color:#fff; border:none; padding:6px 8px; border-radius:6px; }

.admin-image-manager { margin-top:8px; }
.image-list { display:flex; gap:8px; padding:10px 0; list-style:none; margin:0; overflow:auto; }
.image-item { width:86px; height:86px; border-radius:8px; overflow:hidden; position:relative; flex:0 0 auto; background:#f5fbff; display:flex; align-items:center; justify-content:center; }
.image-item img { width:100%; height:100%; object-fit:cover; }
.delete-image-btn { position:absolute; bottom:6px; right:6px; background:#b30000; color:#fff; border:none; padding:4px 6px; border-radius:6px; cursor:pointer; font-size:12px; }

.drop-zone { border:2px dashed #cde6ff; padding:14px; border-radius:8px; cursor:pointer; text-align:center; color:#0d3c78; }
.drop-zone.drag-over { background:#eaf6ff; border-color:#0d3c78; }
.upload-preview { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.upload-preview img { width:72px; height:72px; object-fit:cover; border-radius:8px; border:1px solid #ddd; }
.edit-form { display:flex; flex-direction:column; gap:8px; margin-top:6px; }
.toggle-edit { background:#0d3c78; color:#fff; padding:6px 8px; border-radius:6px; border:none; cursor:pointer; }
.drop-zone input[type="file"] {
  display: none !important;
}

.admin-image-hint { font-size:13px; color:#6b7687; }

@media (max-width:760px){ .card-top { flex-direction:column; align-items:flex-start; } .card-actions { margin-left:0; } }


/* ----------------------------------------------------------
   BUTTON FIXES: Redigera / Ta bort
---------------------------------------------------------- */
.card-actions .toggle-edit {
    background:#0d3c78;
    color:#fff;
    border:none;
    padding:8px 12px;
    border-radius:6px;
    font-size:14px;
    cursor:pointer;
    transition:0.2s;
}

.card-actions .toggle-edit:hover {
    background:#0b2f5d;
}

.card-actions .delete-btn {
    background:#b30000;
    color:#fff;
    border:none;
    padding:8px 12px;
    border-radius:6px;
    font-size:14px;
    cursor:pointer;
    transition:0.2s;
}

.card-actions .delete-btn:hover {
    background:#800000;
}


/* ----------------------------------------------------------
   EDIT FORM STYLING (produkters & addons redigering)
---------------------------------------------------------- */
.edit-form {
    background:#fdfdff;
    padding:16px;
    border-radius:10px;
    box-shadow:0 4px 12px rgba(0,0,0,0.04);
    border:1px solid #e8f2ff;
    margin-top:10px;
}

.edit-form label {
    font-weight:600;
    color:#0d3c78;
    margin-top:10px;
}

.edit-form input,
.edit-form textarea {
    width:100%;
    padding:10px;
    border-radius:8px;
    border:1px solid #d7e8ff;
    margin-bottom:8px;
    background:#fff;
    transition:0.2s;
}

.edit-form input:focus,
.edit-form textarea:focus {
    border-color:#0d3c78;
    outline:none;
    box-shadow:0 0 0 3px rgba(13,60,120,0.12);
}

.edit-form textarea {
    min-height:110px;
    resize:vertical;
}


/* ----------------------------------------------------------
   DRAG-AND-DROP FIX FOR EDIT (matchar create)
---------------------------------------------------------- */
.edit-form .drop-zone {
    border:2px dashed #cde6ff;
    background:#f8fbff;
    padding:16px;
    border-radius:10px;
    text-align:center;
    color:#0d3c78;
    font-weight:500;
    cursor:pointer;
    margin-top:8px;
}

.edit-form .drop-zone.drag-over {
    background:#eaf6ff;
    border-color:#0d3c78;
}

.edit-form .upload-preview {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:10px;
}

.edit-form .upload-preview img {
    width:80px;
    height:80px;
    border-radius:8px;
    object-fit:cover;
    border:1px solid #ddd;
}


/* ----------------------------------------------------------
   EDIT BUTTON INSIDE THE FORM (submit-knappen)
---------------------------------------------------------- */
.edit-form button[type="submit"] {
    margin-top:12px;
    background:#0d3c78;
    color:#fff;
    padding:10px 14px;
    border-radius:8px;
    border:none;
    cursor:pointer;
    font-weight:600;
}

.edit-form button[type="submit"]:hover {
    background:#0b2f5d;
}
/* Preview wrapper */
.preview-thumb {
  position: relative;
  display: inline-block;
  width: 86px;
  height: 86px;
  margin: 6px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f5fb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Bilder */
.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Delete-knapp */
.preview-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #b30000;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  line-height: 22px;
  text-align: center;
  padding: 0;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}

/* Hover-effekt */
.preview-delete:hover {
  opacity: 1;
  transform: scale(1.1);
}
/* Mobile fix for top tabs (Produkter / Tillbehör) */ @media (max-width: 760px) { .admin-controls { flex-direction: column; align-items: stretch; gap: 14px; } .tabs { display: flex; width: 100%; justify-content: center; gap: 8px; flex-wrap: wrap; overflow-x: hidden; } .tab-btn { flex: 1; text-align: center; padding: 10px 0; } #admin-search { width: 100%; min-width: unset; } }


.order-table {
  width: 100%;
  display: block;
  overflow-x: auto;  /* Viktigt för mobil! */
  -webkit-overflow-scrolling: touch;
  white-space: nowrap; /* Förhindrar radbrytning i celler */
}

/* Lite mindre padding på mobil */
@media (max-width: 768px) {
  
  .order-table table,
  .order-table thead,
  .order-table tbody,
  .order-table th,
  .order-table td,
  .order-table tr {
    display: block;
  }

  .order-table thead {
    display: none; /* Dölj kolumnrubriker på mobil */
  }

  .order-table tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
  }

  .order-table td {
    padding: 6px 10px;
    position: relative;
    text-align: left;
    white-space: normal;
  }

  /* Visa egna "etiketter" för varje fält */
  .order-table td::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    color: #555;
    margin-bottom: 3px;
  }

  /* Gör knappar mer mobilvänliga */
  .order-table .btn {
    width: 100%;
    margin-bottom: 6px;
  }

  /* Dropdown ska inte ta hela bredden */
  .order-table select {
    width: 100%;
  }
}
.image-item.dragging {
    opacity: 0.5;
    transform: scale(0.96);
}

.image-item {
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.admin-card .slot-label {
  font-size: 0.85rem;
  color: #555;
  margin: 4px 0 0;
}

.admin-card .status-label {
  margin: 4px 0 0;
}

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.status-active {
  background: #e5f7eb;
  color: #1fa552;
}

.status-inactive {
  background: #fde7e7;
  color: #c0392b;
}

.field-group {
  margin-top: 12px;
}

.field-group .field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.inline-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.inline-checkbox input[type="checkbox"] {
  margin: 0;
  width: 20px;
}

/* 🔹 Samma stil för CREATE + EDIT-formulär i addons-tabben */
.create-addon-form label,
.edit-form label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
  font-size: 0.9rem;
}

.create-addon-form select,
.create-addon-form input[type="text"],
.create-addon-form input[type="number"],
.create-addon-form textarea,
.edit-form select,
.edit-form input[type="text"],
.edit-form input[type="number"],
.edit-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  transition: 0.2s ease;
  margin-bottom: 16px;
}

.create-addon-form select:focus,
.create-addon-form input:focus,
.create-addon-form textarea:focus,
.edit-form select:focus,
.edit-form input:focus,
.edit-form textarea:focus {
  border-color: #1e90ff;
  box-shadow: 0 0 0 3px rgba(30,144,255,0.15);
  outline: none;
}

/* Snygg custom-pil på select i båda formulären */
.create-addon-form select,
.edit-form select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #555 50%),
                    linear-gradient(135deg, #555 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 2px),
                       calc(100% - 10px) calc(50% + 2px);
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
