:root { color-scheme: light; --accent: #635bd2; --ink: #273247; --muted: #657087; --line: #e3e6ee; }
* { box-sizing: border-box; }
body { margin: 0; background: #f5f6fa; color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
a { color: #5149b5; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #5149b5; }
button:disabled { cursor: wait; opacity: .65; }
button.secondary, .button.secondary { color: #4e489b; background: #efedf9; border-color: #e0dcf2; }
button.secondary:hover, .button.secondary:hover { background: #e6e2f7; }
button.danger { color: #a42e39; background: #fff; border-color: #edc9cd; }
button.danger:hover { background: #fff0f1; }
button.link-button { background: transparent; color: #5149b5; padding: 8px; }
:focus-visible { outline: 3px solid #a6a0ec; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin-bottom: 10px; }
h2 { font-size: 22px; line-height: 1.3; margin-bottom: 8px; }
h3 { font-size: 18px; margin-bottom: 6px; }
.account-shell { max-width: 1160px; margin: 0 auto; padding: 24px; }
.account-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; padding: 22px 26px; margin-bottom: 32px; border-radius: 14px; background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.account-header.admin { background: #2c3e50; }
.brand { font-size: 23px; font-weight: 750; color: #fff; text-decoration: none; white-space: nowrap; }
.account-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.account-nav a { padding: 8px 12px; color: #fff; text-decoration: none; border-radius: 7px; }
.account-nav a:hover, .account-nav [aria-current=page] { background: rgba(255,255,255,.18); }
.page-intro { margin-bottom: 24px; }
.muted, .section-description { color: var(--muted); }
.section-description { margin-bottom: 0; }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.section-nav a { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 8px 16px; text-decoration: none; }
.panel { padding: 28px; margin-bottom: 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; scroll-margin-top: 20px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 7px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd1df; border-radius: 8px; background: #fff; color: var(--ink); }
input:read-only { background: #f5f6fa; color: var(--muted); }
textarea { resize: vertical; min-height: 88px; }
input::placeholder, textarea::placeholder { color: #8790a2; }
.hint { display: block; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.message { padding: 12px 14px; margin: 14px 0; border-radius: 8px; background: #f0f3fa; color: #47556e; overflow-wrap: anywhere; }
.message:empty { display: none; }
.message.error { background: #fff1f2; color: #a12c3a; border: 1px solid #f1d0d4; }
.message.success { background: #edf8f0; color: #246a3e; border: 1px solid #cee9d6; }
.empty-state { text-align: center; padding: 34px 18px; background: #f8f9fc; border: 1px dashed #d9deea; border-radius: 10px; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 6px; font-size: 18px; color: var(--ink); }
.empty-state p { margin-bottom: 0; }
.empty-state .button { margin-top: 16px; }
.car-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.car-card { padding: 20px; border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.car-meta { margin: 10px 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; white-space: pre-line; }
.car-card .form-actions { margin-top: 14px; }
.car-editor { padding: 22px; margin-top: 20px; border-radius: 10px; background: #f8f9fc; border: 1px solid var(--line); }
.car-editor h3 { margin-bottom: 20px; }
.orders-list { display: grid; gap: 16px; }
.order-card { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; min-width: 0; }
.order-overview { padding: 20px; }
.order-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.order-number { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.order-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 14px; }
.order-total { font-size: 18px; font-weight: 700; color: var(--ink); }
.status { display: inline-block; padding: 4px 10px; border-radius: 30px; font-size: 12px; font-weight: 650; white-space: nowrap; background: #edf0f5; color: #526078; }
.status-new { background: #fff3d6; color: #875c08; }
.status-processing { background: #e9efff; color: #325aaa; }
.status-paid, .status-completed { background: #e6f6eb; color: #237240; }
.status-shipped { background: #f0eafb; color: #70459e; }
.status-cancelled { background: #fceced; color: #a13c48; }
.order-card details { border-top: 1px solid var(--line); }
.order-card summary { cursor: pointer; padding: 13px 20px; font-size: 14px; font-weight: 600; color: #5149b5; }
.order-card details[open] summary { background: #f8f9fc; }
.order-detail { padding: 18px 20px; }
.order-items { list-style: none; padding: 0; margin: 0 0 18px; }
.order-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.order-item:first-child { padding-top: 0; }
.item-name { font-weight: 600; overflow-wrap: anywhere; }
.item-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; margin-top: 4px; }
.item-price { flex: 0 0 auto; text-align: right; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.detail-grid dt { color: var(--muted); font-size: 13px; }
.detail-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.customer-info { margin-top: 14px; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.status-editor { padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfc; }
.status-editor .form-actions { margin: 0; }
.status-editor select { width: auto; min-width: 170px; }
.status-editor label { margin-bottom: 8px; }
.status-editor .checkbox-label { display: flex; align-items: center; gap: 7px; font-weight: 400; margin-top: 12px; font-size: 13px; }
.checkbox-label input[type="checkbox"] { width: 16px; min-height: 16px; height: 16px; padding: 0; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.toolbar .field { min-width: 180px; }
.toolbar .count { margin-left: auto; color: var(--muted); padding-bottom: 10px; font-size: 14px; }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 480px; padding: 34px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 42px rgba(39,50,71,.06); }
.auth-card .brand { display: block; color: #5149b5; font-size: 20px; margin-bottom: 28px; }
.auth-card h1 { font-size: 28px; }
.auth-card .field { margin-bottom: 18px; }
.auth-card .primary-action { width: 100%; }
.auth-links { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14px; }
.auth-links p { margin-bottom: 10px; }
.password-login { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.password-login summary { cursor: pointer; font-size: 14px; color: #5149b5; }
.password-login form { padding-top: 18px; }
.code-input { text-align: center; font-size: 24px; letter-spacing: .25em; }
.auth-actions { display: grid; gap: 8px; margin-top: 12px; }
.noscript { margin: 20px; padding: 16px; background: #fff3d6; color: #875c08; }
@media (max-width: 640px) {
  .account-shell { padding: 12px; }
  .account-header { padding: 18px; margin-bottom: 24px; gap: 14px; }
  .brand { font-size: 21px; }
  .account-nav { gap: 2px; }
  .account-nav a { padding: 7px 9px; font-size: 14px; }
  .panel { padding: 20px 16px; }
  .form-grid, .car-grid, .detail-grid { grid-template-columns: 1fr; }
  .car-editor { padding: 18px 14px; }
  .order-heading { flex-wrap: wrap; gap: 8px; }
  .order-overview, .order-detail { padding: 16px; }
  .order-card summary { padding: 13px 16px; }
  .status-editor { padding: 14px 16px; }
  .toolbar .count { width: 100%; margin-left: 0; padding-bottom: 0; }
  .auth-card { padding: 26px 22px; }
}
