@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #f1f5f9;
  --surface-color: rgba(255, 255, 255, 0.85);
  --surface-border: rgba(0, 0, 0, 0.1);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --success-color: #10b981;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,90%,1) 0, transparent 50%), 
    radial-gradient(at 50% 0%, hsla(225,39%,90%,0.6) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(339,49%,90%,0.6) 0, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--surface-border);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2rem;
  padding: 0 1.5rem;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar nav a:hover, .sidebar nav a.active {
  color: var(--primary-color);
  background-color: rgba(59, 130, 246, 0.1);
}

.sidebar nav a.active {
  border-left-color: var(--primary-color);
}

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Make headers clickable for sorting */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}
th.sortable:hover {
  color: var(--text-main);
}
th.sortable::after {
  content: '↕';
  position: absolute;
  right: 0.5rem;
  opacity: 0.3;
}
th.sortable.sort-asc::after {
  content: '↑';
  opacity: 1;
}
th.sortable.sort-desc::after {
  content: '↓';
  opacity: 1;
}

.glass-panel {
  background: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

h1, h2, h3 {
  margin-top: 0;
  font-weight: 600;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--surface-border);
  border-radius: 0.5rem;
  color: var(--text-main);
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-row {
  display: flex;
  gap: 1rem;
}
.form-row .form-group {
  flex: 1;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}
.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--surface-border);
}
.btn-ghost:hover {
  background-color: rgba(0,0,0,0.05);
}

.photo-preview {
  width: 100%;
  height: 200px;
  background: rgba(0,0,0,0.03);
  border: 2px dashed var(--surface-border);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--surface-border);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover {
  background-color: rgba(0,0,0,0.02);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-instock {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.status-outstock {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.actions {
  display: flex;
  gap: 0.5rem;
}
