/* style.css - Liff.Store Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #f8fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #0f172a;
  overflow-x: hidden;
}

/* Dark mode */
body.dark {
  background: #0f172a;
  color: #e2e8f0;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

body.dark .navbar {
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.25rem;
  color: #3b82f6;
}

.logo i { font-size: 1.5rem; }

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: #64748b;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: #eef2ff;
  color: #3b82f6;
}

body.dark .nav-links a {
  color: #94a3b8;
}

body.dark .nav-links a:hover,
body.dark .nav-links a.active {
  background: #334155;
  color: #60a5fa;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f1f5f9;
  padding: 0.3rem 0.8rem 0.3rem 1rem;
  border-radius: 2rem;
}

body.dark .user-info {
  background: #334155;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
  color: #3b82f6;
}

body.dark .btn-outline {
  border-color: #475569;
  color: #94a3b8;
}

body.dark .btn-outline:hover {
  background: #334155;
  color: #60a5fa;
}

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
}

.btn-success {
  background: #22c55e;
  color: white;
}

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

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
}

body.dark .card {
  background: #1e293b;
  border-color: #334155;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  border: 1px solid #e2e8f0;
}

body.dark .stat-card {
  background: #1e293b;
  border-color: #334155;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #3b82f6;
}

.stat-card .label {
  font-size: 0.75rem;
  color: #64748b;
}

body.dark .stat-card .label {
  color: #94a3b8;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

body.dark th,
body.dark td {
  border-bottom-color: #334155;
}

th {
  font-weight: 600;
  font-size: 0.8rem;
  color: #64748b;
}

td {
  font-size: 0.85rem;
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #475569;
}

body.dark .form-group label {
  color: #94a3b8;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 2rem;
  border: 1px solid #e2e8f0;
  background: white;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

body.dark .form-group input,
body.dark .form-group select,
body.dark .form-group textarea {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s;
}

.modal.show {
  visibility: visible;
  opacity: 1;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

body.dark .modal-content {
  background: #1e293b;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

body.dark .modal-header {
  border-bottom-color: #334155;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #94a3b8;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  z-index: 2000;
  display: none;
  animation: fadeInUp 0.3s ease;
}

.toast.success { background: #22c55e; }
.toast.error { background: #ef4444; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.product-card {
  background: white;
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

body.dark .product-card {
  background: #1e293b;
  border-color: #334155;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.product-card .title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.product-card .price {
  color: #3b82f6;
  font-weight: 700;
  font-size: 1.1rem;
}

.product-card .stock {
  font-size: 0.7rem;
  color: #64748b;
  margin: 0.5rem 0;
}

.product-card .stock.low {
  color: #ef4444;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 2rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

body.dark footer {
  border-top-color: #334155;
}

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  .navbar { flex-direction: column; align-items: flex-start; }
  .nav-links { width: 100%; overflow-x: auto; padding-bottom: 0.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  th, td { padding: 0.5rem; font-size: 0.75rem; }
}