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

:root {
  --color-bg: #F6F3EC;
  --color-surface: #FFFFFF;
  --color-dark: #1B1712;
  --color-text: #221D17;
  --color-text-muted: #7A7267;
  --color-border: #E9E1D2;
  --color-accent: #FF7A1A;
  --color-accent-dark: #E4610A;
  --color-accent-light: #FFE7D3;
  --color-success: #2CA85A;
  --color-danger: #E24C4C;
  --shadow-sm: 0 2px 8px rgba(27,23,18,0.06);
  --shadow-md: 0 8px 24px rgba(27,23,18,0.10);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--color-bg); color:var(--color-text); font-family:var(--font-body); }
h1,h2,h3 { font-family:var(--font-display); margin:0; }
a { color:inherit; text-decoration:none; }
button { font-family:inherit; cursor:pointer; }

.app-shell { display:flex; min-height:100vh; }
.sidebar { width:230px; background:var(--color-dark); color:#fff; flex-shrink:0; display:flex; flex-direction:column; padding:22px 16px; }
.sidebar__brand { display:flex; align-items:center; gap:10px; font-family:var(--font-display); font-weight:800; font-size:18px; margin-bottom:30px; padding:0 6px; }
.sidebar__brand-mark { width:32px;height:32px;border-radius:9px;background:linear-gradient(145deg,var(--color-accent),var(--color-accent-dark));display:grid;place-items:center; overflow:hidden; }
.sidebar nav { display:flex; flex-direction:column; gap:3px; flex:1; }
.sidebar nav a { padding:10px 14px; border-radius:10px; font-size:14px; font-weight:600; color:rgba(255,255,255,0.65); transition: all .2s; display:flex; align-items:center; gap:10px; }
.sidebar nav a:hover { background:rgba(255,255,255,0.06); color:#fff; }
.nav-badge { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:#fff; color:var(--color-dark); font-size:11.5px; font-weight:800; margin-left:auto; }
.sidebar nav a.active { background:var(--color-accent); color:#fff; }
.sidebar__user { font-size:12px; color:rgba(255,255,255,0.5); padding:10px 6px; border-top:1px solid rgba(255,255,255,0.1); margin-top:10px; }
.sidebar__user a { color:#fff; font-weight:700; }

.main { flex:1; padding:32px 36px; max-width: 1200px; }
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:26px; flex-wrap:wrap; gap:12px; }
.page-header h1 { font-size:24px; }
.page-header p { color:var(--color-text-muted); font-size:14px; margin-top:4px; }

.card { background:var(--color-surface); border-radius:var(--radius-md); padding:22px; box-shadow:var(--shadow-sm); border:1px solid var(--color-border); }
.card + .card { margin-top:18px; }

.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; margin-bottom:24px; }
.stat-card { background:var(--color-surface); border-radius:var(--radius-md); padding:20px; box-shadow:var(--shadow-sm); border:1px solid var(--color-border); }
.stat-card .label { font-size:12px; color:var(--color-text-muted); text-transform:uppercase; letter-spacing:0.04em; font-weight:700; }
.stat-card .value { font-size:28px; font-weight:800; font-family:var(--font-display); margin-top:6px; }

.btn { display:inline-flex; align-items:center; gap:7px; padding:10px 18px; border-radius:var(--radius-pill); font-weight:700; font-size:13.5px; border:none; transition: all .2s; }
.btn-accent { background:var(--color-accent); color:#fff; box-shadow:0 4px 12px rgba(255,122,26,0.3); }
.btn-accent:hover { background:var(--color-accent-dark); transform:translateY(-1px); }
.btn-outline { background:var(--color-surface); color:var(--color-text); border:1px solid var(--color-border); }
.btn-outline:hover { border-color:var(--color-accent); color:var(--color-accent-dark); }
.btn-danger { background:#FDECEC; color:var(--color-danger); }
.btn-danger:hover { background:#fadbdb; }
.btn-sm { padding:6px 13px; font-size:12.5px; }

table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:12px 10px; border-bottom:1px solid var(--color-border); font-size:14px; }
th { font-size:11px; text-transform:uppercase; letter-spacing:0.04em; color:var(--color-text-muted); font-weight:700; }
tr:last-child td { border-bottom:none; }
.table-photo { width:40px; height:40px; border-radius:50%; object-fit:cover; }

.badge { display:inline-flex; align-items:center; padding:4px 10px; border-radius:var(--radius-pill); font-size:11.5px; font-weight:700; }
.badge-on { background:#E4F7EA; color:var(--color-success); }
.badge-off { background:#F2F2F2; color:#888; }
.badge-warn { background:var(--color-accent-light); color:var(--color-accent-dark); }

.field { margin-bottom:16px; }
.field label { display:block; font-weight:700; font-size:13px; margin-bottom:6px; }
.field input, .field select, .field textarea {
  width:100%; padding:10px 13px; border-radius:var(--radius-sm); border:1px solid var(--color-border);
  font-family:inherit; font-size:14px; background:var(--color-bg);
}
.field input:focus, .field select:focus, .field textarea:focus { outline:none; border-color:var(--color-accent); background:#fff; }
.field-hint { font-size:12px; color:var(--color-text-muted); margin-top:4px; }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.option-checklist { max-height:260px; overflow-y:auto; border:1px solid var(--color-border); border-radius:var(--radius-sm); padding:10px 14px; }
.option-checklist label { display:flex; align-items:center; gap:10px; padding:7px 0; font-size:14px; border-bottom:1px solid var(--color-border); }
.option-checklist label:last-child { border-bottom:none; }

.gallery-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px,1fr)); gap:14px; }

.alert { padding:12px 16px; border-radius:var(--radius-sm); font-size:14px; font-weight:600; margin-bottom:18px; }
.alert-success { background:#E4F7EA; color:var(--color-success); }
.alert-error { background:#FDECEC; color:var(--color-danger); }

.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background: var(--color-dark); }
.login-card { background:#fff; border-radius:20px; padding:40px; width:100%; max-width:360px; box-shadow: 0 24px 60px rgba(0,0,0,0.3); }
.login-card h1 { font-size:20px; margin-bottom:4px; }
.login-card p { color:var(--color-text-muted); font-size:13px; margin-bottom:24px; }

.modal-overlay { position:fixed; inset:0; background:rgba(27,23,18,0.55); z-index:300; opacity:0; pointer-events:none; transition:opacity .2s; }
.modal-overlay.open { opacity:1; pointer-events:auto; }
.modal-box { position:fixed; top:50%; left:50%; transform:translate(-50%,-45%); z-index:301; width:min(440px, calc(100vw - 32px)); max-height:80vh; overflow-y:auto;
  background:var(--color-surface); border-radius:var(--radius-md); padding:24px; box-shadow:var(--shadow-md); opacity:0; pointer-events:none; transition:all .2s; }
.modal-box.open { opacity:1; transform:translate(-50%,-50%); pointer-events:auto; }
.modal-box h3 { font-size:17px; margin-bottom:4px; }
.modal-hint { font-size:13px; color:var(--color-text-muted); margin-bottom:14px; }
.icon-chip-row { display:flex; flex-wrap:wrap; gap:6px; min-height:34px; padding:6px; border:1px solid var(--color-border); border-radius:8px; align-items:center; }
.icon-chip { display:inline-flex; align-items:center; gap:4px; background:var(--color-bg); border:1px solid var(--color-border); border-radius:999px; padding:3px 4px 3px 10px; font-size:18px; }
.icon-chip button { background:none; border:none; color:var(--color-text-muted); font-size:14px; font-weight:700; cursor:pointer; width:18px; height:18px; line-height:1; border-radius:50%; }
.icon-chip button:hover { background:var(--color-border); color:var(--color-text); }
.product-group__title { font-size:11px; text-transform:uppercase; letter-spacing:0.04em; color:var(--color-text-muted); font-weight:700; margin:14px 0 4px; }
.product-group__title:first-of-type { margin-top:0; }
.product-check { display:flex; align-items:center; gap:10px; padding:6px 2px; font-size:14px; font-weight:600; border-bottom:1px solid var(--color-border); }
.product-check:last-child { border-bottom:none; }
.modal-box__actions { display:flex; gap:10px; margin-top:18px; }
.modal-box__actions .btn { flex:1; }

@media (max-width: 860px) {
  .app-shell { flex-direction:column; }
  .sidebar { width:100%; flex-direction:row; align-items:center; overflow-x:auto; padding:12px 16px; }
  .sidebar__brand { margin-bottom:0; flex-shrink:0; }
  .sidebar nav { flex-direction:row; }
  .sidebar__user { display:none; }
  .main { padding:16px; max-width:100%; }
  .two-col { grid-template-columns:1fr; }
  .page-header { flex-direction:column; align-items:flex-start; }
  .card { padding:16px; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table { min-width:520px; }
  .stat-grid { grid-template-columns:repeat(2, 1fr); }
}
