/* === Admin Layout === */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f0f4f8;
}

.admin-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0a1628 0%, #0f2847 100%);
  color: #ffffff;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
}

.admin-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1rem;
}

.admin-brand .logo-accent {
  color: var(--gold);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.admin-nav-link i {
  width: 18px;
  text-align: center;
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
}

.admin-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 1.6rem;
  color: #0a1628;
}

.storage-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #eef2ff;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  width: fit-content;
}

.storage-status.localStorage {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.storage-status.cookie {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde68a;
}

.storage-status.default {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.admin-content {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.portfolio-table-wrapper {
  overflow-x: auto;
}

.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.portfolio-table th,
.portfolio-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.portfolio-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  font-weight: 600;
  background: #f8fafc;
}

.portfolio-table tr:hover {
  background: #f8fafc;
}

.portfolio-thumb {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
}

.portfolio-thumb-placeholder {
  width: 64px;
  height: 40px;
  background: #f1f5f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.75rem;
  border: 1px solid #e2e8f0;
}

.action-btns {
  display: flex;
  gap: 8px;
}

.btn-xs {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-edit {
  background: #e0e7ff;
  color: #4338ca;
}

.btn-edit:hover {
  background: #c7d2fe;
}

.btn-delete {
  background: #fee2e2;
  color: #dc2626;
}

.btn-delete:hover {
  background: #fecaca;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #ffffff;
  border-radius: 14px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header h2 {
  font-size: 1.2rem;
  color: #0a1628;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #e2e8f0;
  color: #0a1628;
}

.portfolio-form {
  padding: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #1e293b;
  background: #ffffff;
  transition: all 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 8px;
}

/* === Toast === */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0a1628;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.admin-toast.success {
  border-left: 4px solid #22c55e;
}

.admin-toast.error {
  border-left: 4px solid #ef4444;
}

/* === Responsive === */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    position: relative;
    padding: 16px;
  }

  .admin-main {
    margin-left: 0;
    padding: 20px;
  }

  .admin-layout {
    flex-direction: column;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}