/* Tyrell theme — brand colors #43ABDA (primary) and #000000 (ink), a
   premium display font for headings, and a fixed left sidebar layout. */

:root {
    --brand: #43ABDA;
    --brand-dark: #2E86AD;
    --brand-tint: #EAF6FB;
    --ink: #000000;
    --ink-soft: #333333;
    --surface: #FFFFFF;
    --bg: #F4F7F9;
    --border: #E1E7EB;
    --danger: #D92D20;
    --success: #027A48;
    --sidebar-width: 250px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--ink-soft);
}

h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--ink);
    letter-spacing: 0.2px;
}
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

/* Any use of the main brand mark — sidebar, auth cards — gets the same
   generous size, since it's a wide horizontal lockup (icon+wordmark). */
.brand-logo { width: 200px; height: auto; display: block; }

/* ============ Sidebar layout ============ */
.sidebar-toggle {
    display: none;
    align-items: center; justify-content: center;
    position: fixed; top: 12px; left: 12px; z-index: 40;
    background: var(--ink); color: #fff; border: none; border-radius: 8px;
    width: 38px; height: 38px; padding: 0; cursor: pointer;
}
.sidebar-toggle-icon { width: 20px; height: 20px; display: block; }
.sidebar-toggle-icon svg { width: 100%; height: 100%; }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
    background: var(--ink); color: #fff; display: flex; flex-direction: column;
    padding: 24px 16px; overflow-y: auto; z-index: 30;
}
.sidebar-brand { display: block; padding: 0 8px 24px; }
.admin-badge { color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; padding: 0 8px 20px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px; color: #c9d0d4; text-decoration: none;
    padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--brand); color: #fff; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-icon svg { width: 100%; height: 100%; }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 14px; margin-top: 14px; }
.sidebar-footer .user-chip { display: block; color: #9aa5b4; font-size: 13px; padding: 6px 12px; text-decoration: none; border-radius: 6px; transition: background 0.15s ease, color 0.15s ease; }
.sidebar-footer .user-chip:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-footer .logout-link { display: flex; align-items: center; gap: 12px; color: #c9d0d4; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.sidebar-footer .logout-link:hover { background: rgba(255,255,255,0.06); color: #fff; }

.page { margin-left: var(--sidebar-width); max-width: 1100px; padding: 32px; position: relative; }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 20px; margin-bottom: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky; top: 12px; z-index: 20;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-notif {
    position: relative; display: flex; align-items: center; gap: 8px;
    color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 600;
}
.topbar-notif .nav-icon { width: 22px; height: 22px; color: var(--brand-dark); }
.topbar-notif-badge {
    background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 10px; padding: 1px 7px; line-height: 1.5;
}
.topbar-notif-empty { color: #98a2b3; }
.topbar-notif-empty .nav-icon { color: #98a2b3; }
.topbar-profile {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    padding: 4px 8px; border-radius: 8px; transition: background 0.15s ease;
}
.topbar-profile:hover { background: var(--bg); }
.topbar-profile-text { text-align: right; line-height: 1.3; }
.topbar-profile-name { display: block; font-weight: 600; font-size: 14px; color: var(--ink); }
.topbar-profile-role { display: block; font-size: 12px; color: #667085; }
.topbar-profile-icon { width: 20px; height: 20px; color: #98a2b3; flex-shrink: 0; }
.topbar-settings-link { display: flex; color: #667085; width: 22px; height: 22px; }
.topbar-settings-link:hover { color: var(--brand-dark); }
.topbar-settings-link svg { width: 100%; height: 100%; }
.topbar-logo { display: flex; align-items: center; text-decoration: none; }
.topbar-logo img { width: 200px; min-width: 200px; height: auto; display: block; background: none; border: none; box-shadow: none; }
.topbar-logo-initial {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%; background: var(--brand-tint);
    font-family: 'Playfair Display', serif; font-weight: 700; font-size: 18px; color: var(--brand-dark);
}

@media (max-width: 900px) {
    .sidebar-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 4px 0 16px rgba(0,0,0,0.2); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .page { margin-left: 0; padding: 72px 20px 32px; }
    .topbar { position: static; flex-direction: column; align-items: flex-start; }
    .topbar-right { width: 100%; justify-content: space-between; }
    .topbar-logo img { width: 140px; min-width: 140px; }
}

@media (max-width: 480px) {
    .page { padding: 68px 16px 28px; }
    .tile-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .card { padding: 16px; }
    h1 { font-size: 24px; }
    .topbar-logo img { width: 110px; min-width: 110px; }
}

/* ============ Dashboard tile grid ============ */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 24px 0; }
.tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: var(--brand); color: #fff; text-decoration: none; border-radius: 12px;
    padding: 24px 12px; text-align: center; font-weight: 600; font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(67,171,218,0.35); }
.tile .nav-icon { width: 30px; height: 30px; }
.tile:nth-child(3n+2) { background: var(--ink); }
.tile:nth-child(3n+3) { background: var(--brand-dark); }

/* ============ Shared components ============ */
.card { background: var(--surface); border-radius: 10px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid var(--border); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: 10px; padding: 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid var(--border); }
.stat-value { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: var(--brand-dark); }
.stat-label { color: #667085; font-size: 13px; margin-top: 4px; }

.data-table {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border-radius: 10px; border: 1px solid var(--border);
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table thead { background: var(--brand-tint); color: var(--ink); }
.data-table tfoot td { border-top: 2px solid var(--ink); padding-top: 10px; }
.data-table tr.low-stock { background: #fef3f2; }
.data-table--compact th, .data-table--compact td { padding: 8px 10px; font-size: 13px; }
.data-table--compact .btn-link { padding: 5px 10px; font-size: 12px; }
@media (max-width: 700px) {
    .data-table th, .data-table td { padding: 9px 12px; }
}
.menu-item-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.hint { color: #667089; font-size: 13px; margin-top: 8px; }
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 60px; flex-shrink: 0; font-size: 13px; color: #667085; }
.bar-label-wide { width: 160px; }
.bar-track { flex: 1; background: var(--bg); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand-dark); border-radius: 6px; transition: width 0.2s ease; }
.bar-fill-brand { background: var(--brand); }
.bar-fill-ink { background: var(--ink); }
.bar-value { width: 90px; flex-shrink: 0; text-align: right; font-size: 13px; font-weight: 600; color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

.plain-list { list-style: none; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }

.inline-form { display: inline; }
.stacked-form { display: flex; flex-direction: column; gap: 12px; max-width: 400px; }
.stacked-form label, .auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-soft); }
input, select, textarea {
    padding: 8px 10px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67,171,218,0.2); }

button {
    background: var(--brand); color: #fff; border: none; border-radius: 6px;
    padding: 9px 18px; cursor: pointer; font-size: 14px; font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif; transition: background 0.15s ease;
}
button:hover { background: var(--brand-dark); }
button:disabled { background: #b0b6c0; cursor: not-allowed; }
.link-danger { background: none; color: var(--danger); padding: 0; text-decoration: underline; font-weight: 400; }
.link-danger:hover { background: none; color: #a91d10; }
.btn-link {
    display: inline-block; background: var(--brand-tint); color: var(--brand-dark);
    padding: 6px 14px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 600;
    white-space: nowrap; transition: background 0.15s ease;
}
.btn-link:hover { background: var(--brand); color: #fff; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.alert-error { background: #fef3f2; color: #b42318; border: 1px solid #fda29b; }
.alert-success { background: var(--brand-tint); color: var(--brand-dark); border: 1px solid var(--brand); }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--ink); padding: 20px; }
.auth-page-branded {
    background:
        linear-gradient(rgba(10, 14, 24, 0.72), rgba(10, 14, 24, 0.72)),
        url('/assets/login-bg.jpg') center/cover no-repeat;
}
.auth-card { background: var(--surface); padding: 36px; border-radius: 14px; width: 420px; max-width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,0.35); text-align: center; }
@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
}
.auth-card .brand-logo { margin: 0 auto 18px; }
.auth-card h1 { font-size: 22px; margin-top: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; text-align: left; }
.auth-card p { font-size: 14px; }
.auth-card a { color: var(--brand-dark); font-weight: 600; text-decoration: none; }
.auth-card a:hover { text-decoration: underline; }
.auth-back-link { display: inline-block; margin-bottom: 16px; font-size: 13px; color: #667085 !important; font-weight: 500 !important; }

.logo-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.logo-preview img { max-width: 160px; max-height: 80px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #fff; }
.cover-preview { margin-bottom: 8px; }
.cover-preview img { max-width: 100%; max-height: 180px; width: auto; display: block; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 4px; }

/* ============ POS + storefront shared layout ============ */
.storefront-page { max-width: 1200px; margin: 0 auto; padding: 0 24px 40px; }
.pos-layout, .storefront { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.pos-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.pos-item-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px;
    background: #fff; border: 1px solid var(--border); color: var(--ink-soft); text-align: left;
    border-radius: 8px; font-weight: 600;
}
.pos-item-btn:hover { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(67,171,218,0.15); }
.pos-ticket, .storefront-cart { background: var(--surface); border-radius: 10px; padding: 20px; align-self: start; border: 1px solid var(--border); }
.pos-ticket label, .storefront-cart label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 14px; }
.ticket-lines { list-style: none; padding: 0; }
.ticket-line { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ticket-line button { background: none; color: var(--danger); padding: 0 6px; }
.ticket-line button:hover { background: none; }
.pos-total { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 18px; margin: 14px 0; color: var(--ink); }
.pos-empty { color: #98a2b3; font-size: 14px; padding: 10px 0; }
.pos-change { color: var(--success); font-size: 14px; min-height: 18px; }
#pos-message.success, #sf-message.success { color: var(--success); margin-top: 10px; }
#pos-message.error, #sf-message.error { color: #b42318; margin-top: 10px; }

/* Storefront hero: optional wide cover banner, with a floating white card
   overlapping its bottom edge holding the logo + business name — always on
   a light, legible background, never fighting the photo for contrast.
   Kept compact deliberately so the hero doesn't dominate the page height. */
.sf-cover { width: 100%; height: 200px; object-fit: cover; display: block; }
.sf-header-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; margin-bottom: 16px; }
.sf-header-card {
    background: #fff; border-radius: 14px; padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    border: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.sf-header-brand { display: flex; align-items: center; gap: 16px; }
.sf-header-wrap.has-cover { margin-top: -38px; position: relative; z-index: 5; }
.sf-header-wrap:not(.has-cover) { padding-top: 20px; }
.sf-header-wrap:not(.has-cover) .sf-header-card { box-shadow: none; border: none; padding: 0 0 4px; }
.sf-header-card img.business-logo {
    width: 200px; min-width: 200px; height: auto; display: block;
    background: none; border: none; box-shadow: none; padding: 0;
}
.sf-header-card h1 { color: var(--ink); margin: 0; font-size: 22px; }

.sf-search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
.sf-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #98a2b3; pointer-events: none; }
.sf-search-input {
    width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--bg); font-size: 14px;
}
.sf-search-input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(67,171,218,0.15); }

.sf-category-title { position: relative; padding-bottom: 10px; margin-bottom: 16px; border-bottom: 2px solid var(--brand-tint); }
.sf-item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.sf-item {
    display: flex; flex-direction: column;
    background: #fff; border-radius: 12px; border: 1px solid var(--border);
    overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sf-item:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.sf-item-image { width: 100%; height: 130px; object-fit: cover; display: block; margin: 0; border-radius: 0; }
.sf-item-image-placeholder { background: linear-gradient(135deg, var(--brand-tint), #fff); }
.sf-item-body { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 14px; flex: 1; }
.sf-item-name { font-weight: 600; }
.sf-item-desc { color: #667085; font-size: 13px; margin: 2px 0 0; }
.sf-item-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sf-item-price { color: var(--brand-dark); font-weight: 700; }

.storefront-cart { position: sticky; top: 24px; }

.sf-footer { text-align: center; padding: 40px 24px 32px; color: #98a2b3; font-size: 13px; }
.sf-footer-text { margin: 0 0 10px; }
.sf-footer-logo { display: inline-block; width: 200px; min-width: 200px; height: auto; opacity: 0.85; }

@media (max-width: 1000px) {
    .sf-item-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
    .pos-layout, .storefront { grid-template-columns: 1fr; }
    .sf-cover { height: 130px; }
    .sf-header-wrap.has-cover { margin-top: -30px; }
    .sf-header-card { flex-direction: column; align-items: flex-start; text-align: left; }
    .sf-search-wrap { max-width: none; width: 100%; }
    .sf-header-card img.business-logo { width: 150px; min-width: 150px; }
    .sf-item-grid { grid-template-columns: 1fr; }
    .storefront-cart { position: static; }
}

/* ============ Landing page ============ */
.lp-body { background: #fff; }
.lp-topnav { display: flex; justify-content: flex-end; align-items: center; gap: 20px; padding: 24px 40px; }
.lp-topnav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 14px; }
.lp-topnav a:hover { color: var(--brand-dark); }
.lp-topnav-cta { background: var(--brand); color: #fff !important; padding: 9px 20px; border-radius: 6px; }
.lp-topnav-cta:hover { background: var(--brand-dark); color: #fff !important; }

.lp-hero { max-width: 780px; margin: 40px auto 60px; padding: 0 24px; text-align: center; }
.lp-logo { width: 240px; min-width: 240px; height: auto; display: block; margin: 0 auto 32px; }
.lp-hero h1 { font-size: 44px; line-height: 1.15; margin: 0 0 14px; }
.lp-subhead { font-size: 20px; color: #667085; margin: 0 0 32px; }
.lp-cta-row { display: flex; justify-content: center; gap: 14px; }
.lp-cta-primary {
    background: var(--brand); color: #fff; text-decoration: none; font-weight: 700;
    padding: 13px 30px; border-radius: 8px; font-size: 16px;
}
.lp-cta-primary:hover { background: var(--brand-dark); }
.lp-cta-secondary {
    background: #fff; color: var(--ink); text-decoration: none; font-weight: 700;
    padding: 13px 30px; border-radius: 8px; font-size: 16px; border: 1px solid var(--border);
}
.lp-cta-secondary:hover { border-color: var(--brand); color: var(--brand-dark); }

.lp-tiles-section { max-width: 1000px; margin: 0 auto; padding: 0 24px 80px; }
.lp-tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.lp-tile {
    display: flex; align-items: center; gap: 10px; justify-content: center;
    background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; font-size: 14px;
    border-radius: 999px; padding: 14px 18px; text-align: center;
}
.lp-tile .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.lp-footer { text-align: center; padding: 32px 24px; color: #98a2b3; font-size: 13px; border-top: 1px solid var(--border); }
.lp-footer a { color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.lp-footer a:hover { text-decoration: underline; }

@media (max-width: 700px) {
    .lp-hero h1 { font-size: 28px; }
    .lp-tile-grid { grid-template-columns: repeat(2, 1fr); }
    .lp-topnav { padding: 16px 20px; gap: 12px; }
    .lp-cta-row { flex-direction: column; align-items: stretch; }
}
@media (max-width: 420px) {
    .lp-tile-grid { grid-template-columns: 1fr; }
    .lp-hero { margin: 24px auto 40px; }
    .lp-logo { width: 170px; min-width: 170px; margin-bottom: 20px; }
}
