:root {
    --bg: #f5f5f7;
    --panel: #ffffff;
    --border: #dcdce3;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --primary: #0f172a;
    --accent: #2563eb;
    --accent-2: #7c3aed;
    --success: #16a34a;
    --danger: #dc2626;
    --radius: 16px;
    --ring: rgba(37, 99, 235, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

.link {
    color: var(--accent);
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

.page {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.hero-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-logo {
    font-size: 22px;
    font-weight: 800;
}

.hero-text {
    font-size: 13px;
    color: var(--muted);
}

.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3f4f6;
    border: 1px solid var(--border);
    font-size: 20px;
    font-weight: 700;
}

.top-link {
    margin: 0 0 10px;
}

.card {
    background: var(--panel);
    border-radius: calc(var(--radius) + 2px);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 14px 34px rgba(0,0,0,0.06);
}

.heading {
    margin: 0 0 6px;
    font-size: 24px;
    letter-spacing: -0.01em;
}

h1.heading {
    font-size: 26px;
}

h2.heading {
    font-size: 20px;
}

.subtitle {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.item:last-child {
    border-bottom: none;
}

.item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f3f4f6;
}

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

.item-title {
    font-weight: 700;
}

.meta {
    font-size: 13px;
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qty-edit {
    width: 70px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), #1f2937);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.primary-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.primary-btn:active {
    transform: translateY(0);
}

.toggle-btn {
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text);
    transition: transform 0.15s ease, background 0.15s ease;
}

.toggle-btn:hover {
    background: #eef0f4;
    transform: translateY(-1px);
}

.ghost-btn {
    border: 1px solid var(--border);
    background: #f3f4f6;
    color: var(--text);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
}

.ghost-btn:hover {
    background: #eef0f4;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #f0f0f5;
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
    background: #e9e9f0;
}

.icon-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8f8fb;
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.icon-action-btn:hover {
    background: #eef0f4;
    transform: translateY(-1px);
}

.icon-action-btn.fav-btn.filled {
    color: #e11d48;
    border-color: #fecaca;
    background: #fff;
}

.danger {
    background: #fef2f2;
    color: var(--danger);
    border-color: #fecaca;
}

.summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.summary-total {
    font-size: 18px;
    font-weight: 700;
}

select {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8f8fb;
    color: var(--text);
}

input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8f8fb;
    color: var(--text);
}

input:focus,
select:focus,
button:focus,
a:focus {
    outline: none;
}

input:focus,
select:focus,
.primary-btn:focus,
.toggle-btn:focus,
.ghost-btn:focus,
.icon-btn:focus,
.icon-action-btn:focus {
    box-shadow: 0 0 0 4px var(--ring);
}

.qty-input {
    width: 70px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: #f8f8fb;
    color: var(--text);
}

.search-input {
    width: 100%;
    max-width: 320px;
}

label {
    font-size: 14px;
    color: var(--muted);
}

.status {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8f8fb;
    font-size: 14px;
}

.status.error {
    border-color: #fecaca;
    color: #991b1b;
}

.status.success {
    border-color: #bbf7d0;
    color: #166534;
}

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

.tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(140deg, #ffffff, #f7f7fb);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
}

.tile:hover {
    transform: translateY(-2px);
    border-color: #cbd5f0;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.tile-title {
    font-weight: 700;
}

.tile-desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.profile-menu {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    margin-top: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    display: none;
    box-shadow: 0 14px 30px rgba(0,0,0,0.12);
    z-index: 30;
}

.profile-dropdown button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.profile-dropdown button:hover {
    background: #f2f2f7;
}

.footer {
    background: #0b0b0c;
    color: #f9fafb;
    border-radius: 20px;
    padding: 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
    gap: 24px;
}

.socials {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.footer h4 {
    margin-bottom: 8px;
}

.footer a {
    color: #e5e7eb;
}

.footer .links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.pill-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pill-input input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #2b2b2e;
    background: #121214;
    color: #f5f5f7;
    padding: 10px 14px;
}

.pill-input button {
    border-radius: 999px;
    border: 1px solid #2b2b2e;
    background: #f5f5f7;
    color: #0b0b0c;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
}

.footer-bottom {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

@media (max-width: 768px) {
    .item {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-wrap: wrap;
    }
}
