@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design tokens ─────────────────────────────────────────── */
:root {
    --primary:       #2563eb;
    --primary-hov:   #1d4ed8;
    --primary-lt:    #dbeafe;
    --success:       #16a34a;
    --success-lt:    #dcfce7;
    --success-bd:    #86efac;
    --danger:        #dc2626;
    --danger-hov:    #b91c1c;
    --danger-lt:     #fee2e2;
    --danger-bd:     #fca5a5;
    --warning:       #d97706;
    --warning-lt:    #fef3c7;
    --warning-bd:    #fcd34d;
    --orange:        #ea580c;
    --purple:        #7c3aed;
    --purple-lt:     #ede9fe;

    --text:          #0f172a;
    --text-med:      #475569;
    --text-muted:    #94a3b8;
    --border:        #e2e8f0;
    --border-med:    #cbd5e1;
    --bg:            #f1f5f9;
    --surface:       #ffffff;

    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     14px;

    --shadow-sm:     0 1px 2px rgba(0,0,0,.06);
    --shadow:        0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:     0 4px 12px rgba(0,0,0,.08);
    --shadow-lg:     0 10px 24px rgba(0,0,0,.10);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ──────────────────────────────────────────────────── */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 24px 16px;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ────────────────────────────────────────────── */
h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}
h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-med);
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
h3 { font-size: 14px; font-weight: 600; color: var(--text-med); }

/* ── Layout ────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface);
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.container-narrow {
    max-width: 440px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ── Auth pages — split-screen ─────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px 0;
    margin: -24px -16px;
}

/* Split-screen wrapper */
.split-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
    margin: -24px -16px;
}

/* Left brand panel */
.split-brand {
    flex: 0 0 45%;
    background: linear-gradient(150deg, #1e3a8a 0%, var(--primary) 60%, #0ea5e9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}
.split-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.split-brand-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    max-width: 320px;
}
.split-brand-logo {
    max-height: 80px;
    max-width: 240px;
    margin-bottom: 28px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.split-brand-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.split-brand-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}
.split-brand-tagline {
    font-size: 15px;
    opacity: 0.80;
    line-height: 1.6;
}
.split-brand-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 36px;
    opacity: 0.4;
}
.split-brand-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: white;
}
.split-brand-dots span:first-child { opacity: 1; width: 22px; border-radius: 4px; }

/* Right form panel */
.split-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--bg);
    overflow-y: auto;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}
.auth-brand .brand-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.auth-brand .brand-name { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.auth-brand .brand-sub  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-sub   { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-muted); }

/* Mobile: stack vertically */
@media (max-width: 700px) {
    .split-screen { flex-direction: column; }
    .split-brand  { flex: none; min-height: 200px; padding: 32px 24px; }
    .split-brand-name { font-size: 22px; }
    .split-form   { padding: 32px 16px; }
}

/* ── Dashboard hero ─────────────────────────────────────────── */
.dashboard-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, var(--primary) 70%, #0ea5e9 100%);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    margin-bottom: 28px;
    color: white;
    position: relative;
    overflow: hidden;
}
.dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.dashboard-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 560px;
}
.dashboard-hero h1 {
    font-size: 30px;
    font-weight: 800;
    color: white;
    margin: 0 0 10px;
    letter-spacing: -0.4px;
    line-height: 1.2;
}
.dashboard-hero p {
    font-size: 15px;
    color: rgba(255,255,255,0.82);
    margin: 0 0 28px;
    line-height: 1.6;
}
.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    text-decoration: none;
    color: var(--primary);
}
@media (max-width: 600px) {
    .dashboard-hero { padding: 32px 22px; }
    .dashboard-hero h1 { font-size: 22px; }
}

/* ── Nav (logged-in pages) ─────────────────────────────────── */
.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.topnav-brand {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topnav-brand:hover { text-decoration: none; color: var(--primary); }
.topnav-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Notice bar ── */
.notice-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--warning-lt);
    border: 1px solid var(--warning-bd);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-med);
    margin-bottom: 20px;
    line-height: 1.5;
}
.notice-bar .notice-icon { font-size: 16px; flex-shrink: 0; }

/* ── Nav dropdown ── */
.nav-menu-wrap { position: relative; }
.nav-menu-btn {
    background: var(--surface);
    border: 1px solid var(--border-med);
    border-radius: var(--radius-sm);
    padding: 8px 13px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-med);
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.nav-menu-btn:hover { background: var(--bg); border-color: var(--text-muted); }
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 230px;
    z-index: 999;
    padding: 8px;
}
.nav-dropdown.open { display: block; }
.nav-dropdown a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    gap: 10px;
    white-space: nowrap;
}
.nav-dropdown a:hover { background: var(--bg); color: var(--primary); text-decoration: none; }
.nav-dropdown a.nav-danger { color: var(--text-muted); }
.nav-dropdown a.nav-danger:hover { color: var(--danger); background: var(--danger-lt); }
.nav-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.nav-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ── Page header ───────────────────────────────────────────── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    background: var(--primary);
    color: #fff;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { background: var(--primary-hov); text-decoration: none; }
.btn:active { transform: scale(0.97); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label,
label.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-med);
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border-med);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    appearance: auto;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

input[type="file"] { padding: 8px; }

/* ── Password peek toggle ──────────────────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-peek {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 0;
    transition: color .15s;
}
.pw-peek:hover { color: var(--primary); }
.pw-peek .eye-off { display: none; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-error   { background: var(--danger-lt);  color: #991b1b; border-color: var(--danger-bd); }
.alert-success { background: var(--success-lt); color: #166534; border-color: var(--success-bd); }

/* ── Cart badge ────────────────────────────────────────────── */
.cart-badge {
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    padding: 1px 5px;
    margin-left: -4px;
    vertical-align: top;
    font-weight: 700;
}

/* ── Status badges ─────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
}

/* ── Gallery ───────────────────────────────────────────────── */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.gallery-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    width: 100%;
    transition: box-shadow 0.2s, transform 0.15s;
}
.gallery-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.gallery-item p { padding: 7px 10px; color: var(--text-muted); font-size: 12px; }

.gallery-item-actions { display: flex; gap: 4px; padding: 0 8px 8px; }

.btn-edit    { background: var(--success); flex: 1; text-align: center; padding: 6px 4px; font-size: 12px; }
.btn-edit:hover   { background: #15803d; }
.btn-order   { background: var(--orange); flex: 1; text-align: center; padding: 6px 4px; font-size: 12px; }
.btn-order:hover  { background: #c2410c; }
.btn-delete  { background: var(--danger); flex: 1; text-align: center; padding: 6px 4px; font-size: 12px; }
.btn-delete:hover { background: var(--danger-hov); }

.badge-edited {
    background: var(--success);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Upload form ───────────────────────────────────────────── */
.upload-form {
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 12px;
}
.upload-form .form-group { margin-bottom: 0; flex: 1; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
    body { padding: 10px 8px; }
    .container { padding: 18px 16px; border-radius: var(--radius); }
    .topnav { margin-bottom: 20px; }
    .header { flex-direction: column; align-items: flex-start; }
    .upload-form { flex-direction: column; align-items: stretch; }
    .gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ── Site footer ────────────────────────────────────────────── */
.site-footer {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.site-footer-inner {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.footer-brand { flex: 0 0 200px; }
.footer-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
}
.footer-tagline {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}
.footer-contact {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 12px 24px;
}
.footer-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-med);
    line-height: 1.5;
}
.footer-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.footer-item a { color: var(--text-med); text-decoration: none; }
.footer-item a:hover { color: var(--primary); text-decoration: underline; }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 12px 0;
    font-size: 12px;
    color: var(--text-muted);
}
.pickup-info-box {
    display: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-med);
    line-height: 1.6;
}
.pickup-info-box.show { display: block; }
.pickup-info-box strong { color: var(--text); font-size: 13px; display: block; margin-bottom: 6px; }
@media (max-width: 700px) {
    .site-footer-inner { flex-direction: column; gap: 20px; }
    .footer-brand { flex: 0 0 auto; }
    .footer-contact { grid-template-columns: 1fr; }
}
