:root {
  --accent: #c8102e;
  --bg: #f7f7f8;
  --card: #ffffff;
  --border: #e4e4e7;
  --text: #1c1c1e;
  --muted: #6b7280;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--border); }
.brand-name { font-weight: 700; font-size: 1.1em; margin-right: 6px; }
.brand-tag { color: var(--muted); font-size: 0.85em; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { font-weight: 500; }
.who { color: var(--muted); font-size: 0.85em; }
.link-btn { background: none; border: none; cursor: pointer; color: var(--accent); font: inherit; padding: 0; }
.link-btn.danger { color: #b91c1c; }

.page { max-width: 1080px; margin: 0 auto; padding: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; width: 320px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.login-card h1 { margin: 0; font-size: 1.4em; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9em; }
.login-card input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 1em; }
.login-card button, .btn, .form-card button, .cart button[type=submit] { background: var(--accent); color: #fff; border: none; padding: 10px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.login-card button:disabled, .cart button:disabled { background: #ccc; cursor: not-allowed; }
.alert { background: #fee2e2; color: #991b1b; padding: 8px 10px; border-radius: 8px; font-size: 0.9em; }

.catalog-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.cat-title { margin-top: 24px; margin-bottom: 8px; font-size: 1.05em; }
.service-card { display: flex; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.service-info { flex: 1; }
.price-tag { display: inline-block; margin-top: 6px; font-weight: 600; color: var(--accent); }
.service-action { display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 140px; }
.qty-input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; width: 100%; }
.add-btn { background: var(--text); color: #fff; border: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; }

.cart { position: sticky; top: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.cart-lines { min-height: 40px; margin-bottom: 10px; }
.cart-line { display: flex; justify-content: space-between; font-size: 0.9em; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.cart-line em { color: var(--muted); font-style: normal; font-size: 0.85em; }
.cart-totals div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 0.92em; }
.cart-totals .total { font-weight: 700; font-size: 1.1em; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }
.cart form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cart form input { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table .inactive-row { opacity: 0.5; }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions a { margin-right: 10px; }

.role-badge { padding: 2px 8px; border-radius: 999px; font-size: 0.8em; font-weight: 600; }
.role-user { background: #e5e7eb; color: #374151; }
.role-admin { background: #dbeafe; color: #1e40af; }
.role-superadmin { background: #fee2e2; color: #991b1b; }

.form-card { display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; max-width: 640px; }
.form-card label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9em; }
.form-card input, .form-card select, .form-card textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 1em; }
.form-card .row { display: flex; gap: 12px; }
.form-card .row label { flex: 1; }
.form-card .checkbox { flex-direction: row; align-items: center; gap: 8px; }
.btn-secondary { align-self: flex-start; color: var(--muted); }
.new-category { margin-bottom: 14px; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-form input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.inline-form button { padding: 6px 12px; border-radius: 6px; border: none; background: var(--text); color: #fff; cursor: pointer; }
