:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f3f4f6;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mobile-only { display: none; }
.muted { color: #6b7280; font-size: 13px; }
.error { color: #b91c1c; min-height: 20px; font-size: 13px; }
.brand { font-weight: 800; letter-spacing: .02em; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 18px 50px rgba(15,23,42,.12); display: grid; gap: 18px; }
.login-card h1 { margin: 0; font-size: 24px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: #374151; }
input, textarea, select { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; padding: 10px 12px; color: #111827; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #6b7280; box-shadow: 0 0 0 3px rgba(107,114,128,.12); }
textarea { min-height: 96px; resize: vertical; }
.btn { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 750; }
.btn.primary { background: #111827; color: #fff; }
.btn.secondary { background: #e5e7eb; color: #111827; }
.btn.danger { background: #fee2e2; color: #991b1b; }
.btn.small { padding: 7px 9px; font-size: 12px; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 9px; background: #e5e7eb; font-size: 20px; display: inline-grid; place-items: center; }
.app { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: #111827; color: #fff; padding: 22px 16px; display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; height: 100vh; z-index: 20; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 20px; }
.sidebar nav { display: grid; gap: 6px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.sidebar nav button { border: 0; background: transparent; color: #d1d5db; text-align: left; padding: 11px 12px; border-radius: 9px; font-weight: 700; }
.sidebar nav button:hover, .sidebar nav button.active { background: #374151; color: #fff; }
.notifications-nav::before { content: "●"; color: #D6B56E; font-size: 9px; margin-right: 8px; vertical-align: 1px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding: 16px 8px 0; color: #d1d5db; font-size: 13px; }
.content { padding: 28px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 20px; }
.topbar h1 { margin: 0 0 4px; font-size: 28px; }
.table-wrap { background: #fff; border: 1px solid #e5e7eb; border-radius: 15px; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: middle; font-size: 13px; }
th { color: #6b7280; background: #f9fafb; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #e5e7eb; }
.badge.active { background: #dcfce7; color: #166534; }
.badge.inactive { background: #fee2e2; color: #991b1b; }
.thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: #e5e7eb; }
.notice { margin-bottom: 14px; padding: 11px 13px; border-radius: 10px; background: #ecfdf5; color: #065f46; font-weight: 650; font-size: 13px; }
.notice.error-notice { background: #fef2f2; color: #991b1b; }
.empty { padding: 36px; text-align: center; color: #6b7280; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.modal-card { position: relative; width: min(960px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 25px 80px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.check-row input { width: auto; }
.file-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.file-row input[type=file] { padding: 7px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.gallery-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e5e7eb; }
.gallery-block h3 { margin: 0 0 12px; }
.gallery-upload { display: flex; gap: 8px; margin-bottom: 12px; }
.gallery-upload input { max-width: 380px; }
.gallery-list { display: grid; gap: 9px; }
.gallery-item { display: grid; grid-template-columns: 60px 1fr 90px auto; gap: 10px; align-items: center; padding: 9px; border: 1px solid #e5e7eb; border-radius: 11px; }
.gallery-item .actions { justify-content: flex-end; }

@media (max-width: 900px) {
  .mobile-only { display: inline-grid; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 18px; }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 23px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .modal { padding: 10px; }
  .modal-card { max-height: calc(100vh - 20px); padding: 16px; }
  .gallery-item { grid-template-columns: 52px 1fr; }
  .gallery-item .actions, .gallery-item > input { grid-column: 2; }
}
