/* ============================================================
   AUTOHAUS+ — Exhibition kiosk theme
   Brand colors sampled directly from the AUTOHAUS+ logo:
   black #000000, white #FFFFFF, signature yellow #FFF200.
   Optimized for iPad (touch targets >=48px, large type, no hover-only UI)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Barlow:ital,wght@0,400;0,500;0,600;0,700;0,800;1,700&display=swap');

:root {
    --ink: #000000;
    --bg: #0b0b0b;
    --surface: #161616;
    --surface-2: #202020;
    --line: #2b2b2b;
    --text: #f5f5f2;
    --text-dim: #9a9a94;
    --yellow: #fff200;
    --yellow-dim: #d6cc00;
    --success: #3ecf8e;
    --danger: #ff5c5c;
    --radius: 14px;
    --radius-sm: 8px;
    --cut: 14px;
    --cut-lg: 22px;
    --font-display: 'Anton', 'Arial Narrow', sans-serif;
    --font-body: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: contain;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

img { max-width: 100%; display: block; }

:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 2px;
}

/* Signature shapes — clipped corners, echoing the notched cuts in the
   AUTOHAUS+ wordmark. Used deliberately: primary buttons + hero surfaces
   only, not every element. */
.cut {
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.cut-lg {
    clip-path: polygon(
        0 0, calc(100% - var(--cut-lg)) 0, 100% var(--cut-lg),
        100% 100%, var(--cut-lg) 100%, 0 calc(100% - var(--cut-lg))
    );
}

.hazard-stripe {
    height: 6px;
    background: repeating-linear-gradient(135deg, var(--yellow) 0 14px, #000 14px 28px);
}

/* ---------- Layout ---------- */

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img.logo {
    height: 30px;
    width: auto;
    display: block;
}

.brand small {
    display: block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.4px;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.user-pill .role {
    background: var(--yellow);
    color: var(--ink);
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 4px;
}

.main {
    flex: 1;
    padding: 22px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}

.footer-note {
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    padding: 18px;
}

/* ---------- Bottom nav (thumb-friendly on iPad held in hand) ---------- */

.tabbar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    background: rgba(11,11,11,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    z-index: 20;
    flex-wrap: wrap;
}

.tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: 64px;
    transition: color .15s;
}

.tabbar a .icon { font-size: 20px; line-height: 1; }

.tabbar a .dash {
    width: 14px;
    height: 3px;
    background: transparent;
    border-radius: 2px;
    transition: background .15s;
}

.tabbar a.active, .tabbar a:active {
    color: var(--yellow);
}

.tabbar a.active .dash { background: var(--yellow); }

/* ---------- Cards / grid ---------- */

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

.menu-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 140px;
    justify-content: flex-end;
    transition: transform .12s ease, border-color .12s ease;
}

.menu-card:active { transform: scale(0.97); border-color: var(--yellow); }

.menu-card .icon { font-size: 28px; }
.menu-card h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 19px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.menu-card p { margin: 0; color: var(--text-dim); font-size: 13px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card .media {
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--surface-2), #0e0e0e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    position: relative;
    overflow: hidden;
}

.product-card .media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--yellow);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 11px;
    padding: 5px 12px 5px 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.badge.type-service { background: var(--text); }
.badge.badge-promo { background: #ff3b30; color: #fff; }

.product-card .body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-card h3 { margin: 0; font-size: 16px; font-weight: 700; }
.product-card .desc { color: var(--text-dim); font-size: 13px; line-height: 1.4; flex: 1; }
.product-card .price {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 22px;
    letter-spacing: 0.3px;
    color: var(--yellow);
}
.product-card .price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.product-card .price-old {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 15px;
    letter-spacing: 0.3px;
    color: var(--text-dim);
    text-decoration: line-through;
}
.product-card .price-new {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 22px;
    letter-spacing: 0.3px;
    color: #ff3b30;
}
.product-card .sku { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

.type-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.chip {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.chip.active {
    background: var(--yellow);
    color: var(--ink);
    border-color: var(--yellow);
}

/* ---------- Forms ---------- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.field.full { grid-column: 1 / -1; }

input[type=text], input[type=tel], input[type=email], input[type=number],
input[type=date], input[type=password], select, textarea {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 14px 14px;
    border-radius: var(--radius-sm);
    min-height: 48px;
    width: 100%;
}

textarea { min-height: 90px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255,242,0,0.18);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--yellow);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: none;
    padding: 14px 24px;
    min-height: 50px;
    cursor: pointer;
    font-size: 14px;
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
    transition: transform .1s ease, background .15s ease;
}

.btn:active { transform: scale(0.97); background: var(--yellow-dim); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #1a0505; }
.btn.block { width: 100%; }
.btn.small { padding: 8px 16px; min-height: 36px; font-size: 12px; }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }

/* Wide, many-column tables (records, admin lists) get a min-width so
   columns don't crush together — narrow summary tables (2-4 columns)
   stay fluid to their container instead of forcing a horizontal scroll
   they don't need. */
.table-wrap.wide table { min-width: 640px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); }

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    white-space: nowrap;
}

th {
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td { border-bottom: none; }

.status-pill {
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: var(--surface-2);
    color: var(--text-dim);
    display: inline-block;
    border-left: 3px solid var(--line);
}

.status-new { background: rgba(255,242,0,0.12); color: var(--yellow); border-left-color: var(--yellow); }
.status-contacted { background: rgba(62,207,142,0.15); color: var(--success); border-left-color: var(--success); }
.status-confirmed { background: rgba(62,207,142,0.25); color: var(--success); border-left-color: var(--success); }
.status-done { background: rgba(154,154,148,0.15); color: var(--text-dim); border-left-color: var(--text-dim); }
.status-cancelled { background: rgba(255,92,92,0.15); color: var(--danger); border-left-color: var(--danger); }

/* ---------- Stats ---------- */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--yellow);
    padding: 16px 18px;
}

.stat .label { color: var(--text-dim); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat .value {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 28px;
    letter-spacing: 0.3px;
    margin-top: 6px;
}
.stat .value.accent { color: var(--yellow); }

/* ---------- Misc ---------- */

h1, h2, h3 { line-height: 1.2; }
h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 26px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin: 0 0 18px;
}
h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin: 0 0 14px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.page-head h1 { margin: 0; }

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    border-left: 3px solid transparent;
}

.alert.success { background: rgba(62,207,142,0.12); color: var(--success); border-left-color: var(--success); }
.alert.error { background: rgba(255,92,92,0.12); color: var(--danger); border-left-color: var(--danger); }

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-dim);
}

.empty-state .icon { font-size: 42px; margin-bottom: 10px; }

/* ---------- Login screen ---------- */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 15% 15%, rgba(255,242,0,0.07), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(255,242,0,0.05), transparent 40%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}

.login-card .login-body { padding: 34px 30px 30px; }

.login-card .logo-wrap { display: flex; justify-content: center; margin-bottom: 22px; }
.login-card .logo-wrap img { height: 44px; width: auto; }

.login-card .sub {
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 28px;
}

.hint-box {
    margin-top: 20px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
}

/* Larger tap targets on touch devices */
@media (pointer: coarse) {
    .btn, .chip, .tabbar a { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
    .menu-card, .btn { transition: none; }
    .menu-card:active, .btn:active { transform: none; }
}
