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

:root {
  --green-dark: #1B5E20;
  --green-mid: #2E7D32;
  --green-light: #4CAF50;
  --green-pale: #E8F5E9;
  --bg: #0d1f0d;
  --bg-card: #1a2e1a;
  --bg-input: #1e3a1e;
  --text: #e0e0e0;
  --text-muted: #9e9e9e;
  --border: #2E7D32;
  --danger: #ef5350;
  --warning: #FFA726;
  --info: #42A5F5;
  --vip: #FFD700;
  --high: #FF9800;
  --medium: #42A5F5;
  --standard: #9e9e9e;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.navbar {
  background: var(--green-dark); padding: 0.75rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.nav-brand { font-weight: 700; font-size: 1.1rem; color: #fff; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }
.nav-links a { color: #c8e6c9; text-decoration: none; padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.85rem; transition: background 0.2s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.15); color: #fff; }
.nav-user { color: #a5d6a7; font-size: 0.8rem; padding: 0 0.5rem; }
.nav-logout { color: #ef9a9a !important; }
.nav-export { color: #fff59d !important; }
.nav-toggle { display: none; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

.container { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.card h3 { color: #fff; font-size: 1.1rem; }
.card-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.5rem; font-size: 0.85rem; }
.card-meta .label { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; }
.card-meta .value { font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 700; }
.badge-vip { background: var(--vip); color: #000; }
.badge-high { background: var(--high); color: #000; }
.badge-medium { background: var(--medium); color: #fff; }
.badge-standard { background: var(--standard); color: #fff; }
.badge-reseller { background: #9C27B0; color: #fff; }
.badge-status { background: var(--green-mid); color: #fff; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; text-align: center; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--green-light); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
input, select, textarea { width: 100%; padding: 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-input); color: var(--text); font-size: 0.9rem; }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

.btn { display: inline-block; padding: 0.6rem 1.2rem; border: none; border-radius: 6px; font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.btn-primary { background: var(--green-mid); color: #fff; }
.btn-primary:hover { background: var(--green-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.8; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* Filters bar */
.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.5rem; background: var(--bg-card); padding: 1rem; border-radius: 10px; border: 1px solid var(--border); }
.filters .form-group { margin-bottom: 0; min-width: 150px; flex: 1; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem; text-align: left; border-bottom: 1px solid rgba(46,125,50,0.3); font-size: 0.85rem; }
th { color: var(--green-light); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }
tr:hover { background: rgba(46,125,50,0.1); }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 0.4rem 0.8rem; border-radius: 6px; text-decoration: none; font-size: 0.85rem; }
.pagination a { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.pagination a:hover { background: var(--green-mid); }
.pagination .current { background: var(--green-mid); color: #fff; }

/* Products list */
.product-list { list-style: none; padding: 0; }
.product-list li { padding: 0.3rem 0; font-size: 0.85rem; display: flex; justify-content: space-between; }
.product-list li .qty { color: var(--green-light); font-weight: 600; }

/* Categories */
.cat-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.cat-tag { background: var(--green-dark); color: #a5d6a7; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.75rem; }

/* Script page */
.script-section { margin-bottom: 2rem; }
.script-section h2 { color: var(--green-light); margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.script-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; line-height: 1.7; }
.script-box p { margin-bottom: 0.75rem; }
.script-box .emphasis { color: var(--green-light); font-weight: 600; }

/* Login */
.login-container { max-width: 400px; margin: 4rem auto; }
.login-container h1 { text-align: center; color: var(--green-light); margin-bottom: 1.5rem; }
.login-error { background: rgba(239,83,80,0.2); color: var(--danger); padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; text-align: center; }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }

/* Alert */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: rgba(76,175,80,0.2); color: var(--green-light); }
.alert-error { background: rgba(239,83,80,0.2); color: var(--danger); }

/* Footer */
.footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.8rem; }

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; flex-direction: column; width: 100%; margin-top: 0.5rem; }
  .nav-links.show { display: flex; }
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .card-meta { grid-template-columns: repeat(2, 1fr); }
  .filters { flex-direction: column; }
  .container { padding: 1rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.4rem; }
}
