/* ============================================================
   Sagara Meat House – Global Styles (Modern Redesign)
   ============================================================ */

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

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

:root {
    --sidebar-bg:   #1a0a0b;
    --sidebar-hover:#2d1214;
    --sidebar-active:#4a1c1f;
    --header-bg:    #ffffff;
    --primary:      #dc2626;
    --primary-dark: #991b1b;
    --primary-light: #fecaca;
    --success:      #16a34a;
    --success-light:#dcfce7;
    --warning:      #ea580c;
    --warning-light:#fff7ed;
    --danger:       #dc2626;
    --danger-light: #fef2f2;
    --info:         #2563eb;
    --info-light:   #eff6ff;
    --bg:           #f8f6f3;
    --card-bg:      #ffffff;
    --border:       #e5e0db;
    --text:         #1c1917;
    --text-muted:   #78716c;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 1px 3px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.06);
    --shadow-lg:    0 4px 6px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.08);
    --shadow-xl:    0 20px 60px rgba(0,0,0,.12);
    --transition:   all .2s cubic-bezier(.4,0,.2,1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg); color: var(--text); min-height: 100vh;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1a0a0b 0%, #2d1214 60%, #3e1012 100%);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; height: 100vh;
    z-index: 100; overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #fff;
    text-align: center;
}
.sidebar-logo-img {
    width: 64px; height: 64px; object-fit: contain;
    border-radius: 50%; margin-bottom: 10px;
    background: rgba(255,255,255,.08);
    padding: 4px; border: 2px solid rgba(255,255,255,.12);
    transition: var(--transition);
}
.sidebar-logo-img:hover { border-color: var(--primary); transform: scale(1.05); }
.sidebar-logo h2 { font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.sidebar-logo span { font-size: 11px; opacity: .5; font-weight: 400; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; color: rgba(255,255,255,.65);
    text-decoration: none; font-size: 13.5px; font-weight: 500;
    transition: var(--transition); border-radius: 0;
    margin: 1px 10px; border-radius: var(--radius-sm);
    position: relative;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,.08); color: #fff;
}
.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%);
    color: #fff; font-weight: 600;
    box-shadow: 0 4px 12px rgba(220,38,38,.35);
}
.sidebar-nav .nav-icon  { width: 22px; text-align: center; font-size: 16px; flex-shrink: 0; }
.sidebar-nav .nav-section {
    padding: 20px 20px 6px; font-size: 10px; text-transform: uppercase;
    letter-spacing: .12em; color: rgba(255,255,255,.3); font-weight: 600;
}

.main-wrapper {
    margin-left: var(--sidebar-width); flex: 1;
    display: flex; flex-direction: column; min-height: 100vh;
}

.header {
    background: rgba(255,255,255,.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height); display: flex; align-items: center;
    justify-content: space-between; padding: 0 28px;
    position: sticky; top: 0; z-index: 50;
}
.header-title { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.header-right { display: flex; align-items: center; gap: 14px; }
.header-user  { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.content { padding: 28px; flex: 1; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer;
    font-size: 13px; font-weight: 600; transition: var(--transition);
    font-family: inherit; letter-spacing: -.01em;
    position: relative; overflow: hidden;
}
.btn::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 100%);
    pointer-events: none;
}
.btn:hover   { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn:active  { transform: translateY(0); box-shadow: none; }
.btn-primary  { background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(220,38,38,.35); }
.btn-success  { background: linear-gradient(135deg, var(--success) 0%, #15803d 100%); color: #fff; }
.btn-success:hover { box-shadow: 0 4px 16px rgba(22,163,74,.35); }
.btn-danger   { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); color: #fff; }
.btn-warning  { background: linear-gradient(135deg, var(--warning) 0%, #c2410c 100%); color: #fff; }
.btn-outline  {
    background: var(--card-bg); border: 1.5px solid var(--border); color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.btn-outline::after { display: none; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--danger-light); }
.btn-sm       { padding: 5px 12px; font-size: 12px; border-radius: 6px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 24px;
    border: 1px solid rgba(0,0,0,.04);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }

.stats-grid  { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card   {
    background: var(--card-bg); border-radius: var(--radius); padding: 22px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 18px;
    border: 1px solid rgba(0,0,0,.04); transition: var(--transition);
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    border-radius: 4px 0 0 4px;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon   {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.stat-icon.blue     { background: var(--info-light); color: var(--info); }
.stat-icon.green    { background: var(--success-light); color: var(--success); }
.stat-icon.orange   { background: var(--warning-light); color: var(--warning); }
.stat-icon.red      { background: var(--danger-light); color: var(--danger); }
.stat-card:nth-child(1)::before { background: var(--info); }
.stat-card:nth-child(2)::before { background: var(--success); }
.stat-card:nth-child(3)::before { background: var(--warning); }
.stat-card:nth-child(4)::before { background: var(--danger); }
.stat-card:nth-child(5)::before { background: var(--primary); }
.stat-body  .label  { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-body  .value  { font-size: 24px; font-weight: 800; line-height: 1.2; margin-top: 4px; letter-spacing: -.02em; }

/* ── Tables ──────────────────────────────────────────────── */
.table-container { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
    padding: 12px 16px; text-align: left;
    font-weight: 700; color: var(--text-muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 2px solid var(--border); position: sticky; top: 0;
}
tbody tr {
    border-bottom: 1px solid rgba(0,0,0,.04);
    transition: var(--transition);
}
tbody tr:hover { background: linear-gradient(90deg, rgba(220,38,38,.03) 0%, rgba(220,38,38,.01) 100%); }
tbody td { padding: 13px 16px; }
tfoot th, tfoot td {
    padding: 14px 16px; font-weight: 800; font-size: 14px;
    background: linear-gradient(180deg, #fef2f2 0%, #fff5f5 100%);
    border-top: 2px solid var(--primary);
    color: var(--primary-dark);
}
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ── Badges / Status ─────────────────────────────────────── */
.badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em;
}
.badge-success  { background: var(--success-light); color: #15803d; }
.badge-warning  { background: var(--warning-light); color: #c2410c; }
.badge-danger   { background: var(--danger-light); color: #b91c1c; }
.badge-info     { background: var(--info-light); color: #1d4ed8; }
.badge-default  { background: #f5f5f4; color: #57534e; }
.badge-direct   { background: #eef2ff; color: #4338ca; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; padding: 0 4px; }
.tab-btn {
    padding: 12px 22px; border: none; background: none; cursor: pointer;
    font-size: 13.5px; font-weight: 600; color: var(--text-muted);
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: var(--transition); border-radius: 8px 8px 0 0;
    font-family: inherit;
}
.tab-btn:hover  { color: var(--primary); background: rgba(220,38,38,.04); }
.tab-btn.active {
    color: var(--primary); border-bottom-color: var(--primary);
    background: rgba(220,38,38,.06);
}

.channel-header {
    display: none; padding: 12px 20px; border-radius: var(--radius);
    margin-bottom: 16px; font-weight: 600; font-size: 15px; align-items: center; gap: 10px;
}
.channel-header.show { display: flex; }

/* ── Forms & Modals ──────────────────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal {
    background: #fff; border-radius: 16px; box-shadow: var(--shadow-xl);
    width: 90%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column;
    animation: slideUp .3s ease;
}
.modal-lg { max-width: 860px; }
.modal-header {
    padding: 20px 28px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-title  { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.modal-close  {
    background: #f5f5f4; border: none; font-size: 18px; cursor: pointer;
    color: var(--text-muted); width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body   { padding: 24px 28px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 16px 28px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px;
    background: #fafaf9;
    border-radius: 0 0 16px 16px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px;
    color: var(--text); text-transform: uppercase; letter-spacing: .03em;
}
.form-control {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13.5px; transition: var(--transition); font-family: inherit;
    background: #fff;
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Page-header row ─────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }

/* ── Filters ─────────────────────────────────────────────── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filter-select, .filter-input {
    padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; font-family: inherit; transition: var(--transition);
}
.filter-select:focus, .filter-input:focus {
    border-color: var(--primary); outline: none;
    box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pagination button {
    padding: 6px 14px; border: 1.5px solid var(--border); background: #fff;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
    font-family: inherit; font-weight: 600; transition: var(--transition);
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active {
    background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%);
    color: #fff; border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(220,38,38,.25);
}
.pagination button:disabled { opacity: .35; cursor: default; }

/* ── Alert / toast ───────────────────────────────────────── */
.toast {
    position: fixed; top: 24px; right: 24px; z-index: 999;
    padding: 14px 24px; border-radius: var(--radius); color: #fff;
    font-size: 14px; font-weight: 600; box-shadow: var(--shadow-xl);
    transform: translateX(120%); transition: transform .35s cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(8px);
}
.toast.show { transform: translateX(0); }
.toast.success { background: linear-gradient(135deg, var(--success) 0%, #15803d 100%); }
.toast.error   { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.toast.warning { background: linear-gradient(135deg, var(--warning) 0%, #c2410c 100%); }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a0a0b 0%, #3e1012 40%, #7b2226 100%);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(220,38,38,.15) 0%, transparent 70%);
    top: -200px; right: -200px; pointer-events: none;
}
.login-page::after {
    content: ''; position: absolute; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(220,38,38,.1) 0%, transparent 70%);
    bottom: -100px; left: -100px; pointer-events: none;
}
.login-card {
    background: rgba(255,255,255,.97); border-radius: 20px; padding: 48px;
    width: 400px; box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.3);
    animation: slideUp .5s ease;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-img {
    width: 88px; height: 88px; object-fit: contain; border-radius: 50%;
    margin-bottom: 14px; border: 3px solid rgba(220,38,38,.15);
}
.login-logo h1 { font-size: 24px; color: var(--text); font-weight: 900; letter-spacing: -.03em; }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }

/* ── Items editor in modals ──────────────────────────────── */
.items-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.items-table th {
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
    padding: 10px 12px; font-size: 11px; color: var(--text-muted);
    text-align: left; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.items-table td { padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,.04); }
.items-table input, .items-table select {
    width: 100%; padding: 7px 10px; border: 1.5px solid var(--border);
    border-radius: 6px; font-size: 12px; font-family: inherit;
    transition: var(--transition);
}
.items-table input:focus, .items-table select:focus {
    border-color: var(--primary); outline: none;
    box-shadow: 0 0 0 2px rgba(220,38,38,.08);
}

/* ── Catalog / Homepage ──────────────────────────────────── */
.catalog-page {
    background: var(--bg); min-height: 100vh; display: flex; flex-direction: column;
}
.catalog-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Navbar */
.catalog-nav {
    background: #fff; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.catalog-nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; gap: 16px;
}
.catalog-nav-links {
    display: flex; align-items: center; gap: 4px; margin-left: auto;
}
.catalog-nav-links .nav-link {
    padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--text);
    text-decoration: none; border-radius: 8px; transition: background .2s, color .2s;
}
.catalog-nav-links .nav-link:hover {
    background: rgba(0,0,0,.04); color: var(--primary);
}
.catalog-nav-links .nav-link.active {
    color: var(--primary); font-weight: 600; background: rgba(183,28,28,.06);
}
.catalog-nav-right {
    display: flex; align-items: center; gap: 8px; margin-left: 8px;
}
.catalog-brand {
    font-size: 20px; font-weight: 800; color: var(--sidebar-bg);
    text-decoration: none; letter-spacing: -.02em;
    display: flex; align-items: center; gap: 8px;
}
.nav-logo-img { width: 36px; height: 36px; object-fit: contain; border-radius: 50%; }
.catalog-brand:hover { color: var(--primary); }
.btn-nav-login { font-size: 13px; padding: 7px 18px; border-radius: 20px; }

/* Hero */
.catalog-hero {
    background: linear-gradient(135deg, #1a0a0b 0%, #3e1012 40%, #7b2226 70%, #dc2626 100%);
    color: #fff; padding: 72px 0 60px; text-align: center;
    position: relative; overflow: hidden;
}
.catalog-hero::before {
    content: ''; position: absolute; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
    top: -200px; right: -100px; pointer-events: none;
}
.catalog-hero h1 { font-size: 36px; font-weight: 900; margin-bottom: 12px; letter-spacing: -.03em; }
.hero-highlight { color: #fca5a5; }
.catalog-hero p { font-size: 16px; opacity: .85; margin-bottom: 28px; }
.hero-search {
    display: flex; gap: 10px; max-width: 520px; margin: 0 auto;
}
.hero-search-input {
    flex: 1; padding: 12px 18px; border: none; border-radius: 8px;
    font-size: 15px; outline: none; box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.hero-search-input::placeholder { color: #aaa; }
.hero-search-btn { border-radius: 8px; padding: 12px 24px; font-size: 15px; font-weight: 600; }

/* Filter bar */
.catalog-main { padding-top: 24px; padding-bottom: 40px; flex: 1; }
.catalog-filter-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.cat-filter-btn {
    padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border);
    background: #fff; cursor: pointer; font-size: 13px; font-weight: 500;
    color: var(--text-muted); transition: all .2s;
}
.cat-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.catalog-sort { margin-left: auto; }
.catalog-results-info { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* Product grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Product card */
.product-card {
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
    transition: var(--transition); cursor: default;
    border: 1px solid rgba(0,0,0,.04);
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.product-card.out-of-stock { opacity: .6; }
.product-card.out-of-stock .product-thumb::after {
    content: 'HABIS'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.55); color: #fff; font-size: 20px;
    font-weight: 800; letter-spacing: .1em;
}

.product-thumb {
    height: 180px; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.product-initials {
    font-size: 48px; font-weight: 900; color: rgba(255,255,255,.85);
    letter-spacing: .05em; text-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.product-category-tag {
    position: absolute; top: 12px; left: 12px;
    background: rgba(255,255,255,.9); color: #333;
    padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
}

.product-info { padding: 16px; }
.product-code { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.product-name { font-size: 15px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; color: var(--text); }
.product-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.product-unit { font-size: 11px; color: var(--text-muted); background: #f5f5f5; padding: 2px 8px; border-radius: 10px; }
.product-price { font-size: 18px; font-weight: 800; color: var(--primary); }

/* Stock badges */
.stock-badge {
    font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 10px;
}
.stock-badge.in-stock  { background: #e8f5e9; color: #2e7d32; }
.stock-badge.low-stock { background: #fff8e1; color: #f57f17; }
.stock-badge.out-stock { background: #ffebee; color: #c62828; }

/* Empty state */
.catalog-empty {
    display: flex; flex-direction: column; align-items: center;
    padding: 60px 0; color: var(--text-muted);
}
.catalog-empty .empty-icon { font-size: 56px; margin-bottom: 12px; }
.catalog-empty h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.catalog-empty p { font-size: 14px; }

/* Footer */
.catalog-footer {
    background: var(--sidebar-bg); color: rgba(255,255,255,.6);
    text-align: center; padding: 20px 0; font-size: 13px; margin-top: auto;
}

/* Product price row */
.product-price-row { display: flex; align-items: center; justify-content: space-between; }
.btn-cart { font-size: 11px; padding: 4px 10px; border-radius: 16px; }

/* ── Cart ────────────────────────────────────────────────── */
.cart-fab {
    position: fixed; bottom: 28px; right: 28px; z-index: 150;
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%);
    color: #fff; border: none;
    font-size: 24px; cursor: pointer;
    box-shadow: 0 6px 20px rgba(220,38,38,.4);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.cart-fab:hover { transform: scale(1.1); box-shadow: 0 8px 28px rgba(220,38,38,.5); }
.cart-fab-bounce { animation: fabBounce .4s ease; }
@keyframes fabBounce { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }
.cart-fab-count {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
    min-width: 20px; height: 20px; border-radius: 10px;
    display: none; align-items: center; justify-content: center; padding: 0 5px;
}

.cart-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200;
}
.cart-overlay.open { display: block; }

.cart-drawer {
    position: fixed; top: 0; right: -400px; width: 380px; height: 100vh;
    background: #fff; z-index: 210; display: flex; flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,.15); transition: right .3s ease;
}
.cart-drawer.open { right: 0; }
.cart-drawer-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.cart-drawer-header h3 { font-size: 16px; font-weight: 700; }
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cart-drawer-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; }
.cart-checkout-form { display: flex; flex-direction: column; gap: 8px; }

.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.cart-item-price { font-size: 12px; color: var(--primary); }
.cart-item-actions { display: flex; align-items: center; gap: 6px; }
.cart-item-qty { width: 28px; text-align: center; font-weight: 700; font-size: 14px; }

/* ── Profile page ────────────────────────────────────────── */
.profile-card { max-width: 520px; }
.profile-avatar {
    width: 88px; height: 88px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 34px; font-weight: 900; margin: 0 auto 18px;
    box-shadow: 0 4px 16px rgba(220,38,38,.3);
    border: 3px solid rgba(255,255,255,.5);
}

/* ── Low-stock alert ─────────────────────────────────────── */
.low-stock-alert {
    background: linear-gradient(90deg, #fff7ed 0%, #fffbeb 100%);
    border: 1.5px solid #fed7aa; border-radius: var(--radius);
    padding: 18px 22px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 14px;
    box-shadow: 0 2px 8px rgba(234,88,12,.06);
}
.low-stock-alert .alert-icon { font-size: 26px; flex-shrink: 0; }
.low-stock-alert .alert-body { flex: 1; }
.low-stock-alert .alert-title { font-weight: 800; font-size: 14px; margin-bottom: 4px; color: #c2410c; }
.low-stock-alert .alert-list { font-size: 13px; color: #78350f; }

/* ── Order alert ─────────────────────────────────────────── */
.order-alert {
    background: linear-gradient(90deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1.5px solid #93c5fd; border-radius: var(--radius);
    padding: 18px 22px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 14px;
    animation: orderPulse 2.5s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(37,99,235,.06);
}
.order-alert .alert-icon { font-size: 26px; flex-shrink: 0; }
.order-alert .alert-body { flex: 1; }
.order-alert .alert-title { font-weight: 800; font-size: 14px; margin-bottom: 4px; color: #1d4ed8; }
.order-alert .alert-list { font-size: 13px; color: #1e3a5f; }
@keyframes orderPulse {
    0%, 100% { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(37,99,235,.06); }
    50% { border-color: #f97316; box-shadow: 0 0 16px rgba(249,115,22,.15); }
}
.order-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.notification-bell {
    position: relative; cursor: pointer; font-size: 20px;
    transition: var(--transition);
}
.notification-bell:hover { transform: scale(1.15); }
.notification-badge {
    position: absolute; top: -6px; right: -8px;
    background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%);
    color: #fff; font-size: 10px; font-weight: 800;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
    box-shadow: 0 2px 6px rgba(220,38,38,.4);
}

/* ── Responsive: Mobile (Android & iOS) ──────────────────── */

/* Hamburger toggle button (hidden on desktop) */
.sidebar-toggle {
    display: none; background: none; border: none; font-size: 24px;
    cursor: pointer; padding: 4px 8px; color: var(--text);
    border-radius: var(--radius-sm); transition: var(--transition);
}
.sidebar-toggle:hover { background: rgba(0,0,0,.06); }

/* Mobile overlay for sidebar */
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 99; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .stat-body .value { font-size: 20px; }
    .content { padding: 20px; }
}

/* Mobile: up to 768px */
@media (max-width: 768px) {
    /* Sidebar: slide-in drawer on mobile */
    .sidebar {
        width: 280px; transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.25);
    }
    .sidebar-overlay.show { display: block; }
    .sidebar-toggle { display: block; }
    .sidebar-nav a { padding: 12px 20px; margin: 2px 10px; }
    .sidebar-nav a span { display: inline; }
    .sidebar-logo h2, .sidebar-logo span { display: block; }
    .nav-section { display: block; }

    /* Main area */
    .main-wrapper { margin-left: 0; }
    .header { padding: 0 16px; height: 56px; }
    .header-title { font-size: 16px; }
    .header-user { display: none; }
    .content { padding: 16px; }

    /* Page header */
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header h1 { font-size: 20px; }
    .page-header > div { width: 100%; display: flex; gap: 8px; }
    .page-header > div .btn { flex: 1; justify-content: center; }

    /* Stats cards */
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 16px; gap: 14px; }
    .stat-icon { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
    .stat-body .value { font-size: 20px; }
    .stat-body .label { font-size: 11px; }

    /* Tables: horizontal scroll with touch */
    .table-container { -webkit-overflow-scrolling: touch; }
    table { font-size: 12px; }
    thead th { padding: 10px 12px; font-size: 10px; white-space: nowrap; }
    tbody td { padding: 10px 12px; white-space: nowrap; }
    tfoot th, tfoot td { padding: 12px; font-size: 13px; }

    /* Cards */
    .card { padding: 16px; border-radius: var(--radius-sm); }

    /* Forms */
    .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 10px; }
    .form-control { padding: 12px 14px; font-size: 16px; /* prevents iOS zoom */ }
    select.form-control { font-size: 16px; }
    .form-group label { font-size: 11px; }

    /* Modals: fullscreen on mobile */
    .modal {
        width: 100%; max-width: 100%; max-height: 100vh;
        border-radius: 16px 16px 0 0; margin-top: auto;
    }
    .modal-header { padding: 16px 20px; }
    .modal-body { padding: 16px 20px; }
    .modal-footer { padding: 14px 20px; }
    .modal-title { font-size: 16px; }

    /* Tabs: horizontal scroll */
    .tabs {
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap; gap: 0; padding: 0;
        scrollbar-width: none; -ms-overflow-style: none;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-btn { padding: 10px 16px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

    /* Filters: stack */
    .filters { flex-direction: column; gap: 8px; }
    .filter-input, .filter-select { width: 100%; }
    .filters .btn { width: 100%; justify-content: center; }

    /* Pagination */
    .pagination { gap: 4px; }
    .pagination button { padding: 6px 10px; font-size: 12px; }

    /* Badges */
    .badge { font-size: 10px; padding: 3px 8px; }

    /* Buttons */
    .btn { padding: 10px 16px; font-size: 13px; }
    .btn-sm { padding: 7px 12px; font-size: 12px; }

    /* Toast: full width on mobile */
    .toast {
        top: auto; bottom: 16px; left: 16px; right: 16px;
        border-radius: var(--radius); font-size: 13px; padding: 12px 18px;
    }

    /* Login card */
    .login-card {
        width: 100%; max-width: 360px; padding: 32px 24px;
        margin: 16px; border-radius: 16px;
    }
    .login-logo-img { width: 72px; height: 72px; }
    .login-logo h1 { font-size: 20px; }

    /* Alerts */
    .low-stock-alert, .order-alert { padding: 14px 16px; }
    .low-stock-alert .alert-icon, .order-alert .alert-icon { font-size: 22px; }

    /* Catalog */
    .catalog-hero h1 { font-size: 24px; }
    .catalog-hero { padding: 40px 16px 32px; }
    .catalog-hero p { font-size: 14px; }
    .hero-search { flex-direction: column; padding: 0 8px; }
    .hero-search-input { font-size: 16px; padding: 12px 16px; }
    .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-thumb { height: 120px; }
    .product-initials { font-size: 28px; }
    .product-info { padding: 12px; }
    .product-name { font-size: 13px; }
    .product-price { font-size: 15px; }
    .catalog-container { padding: 0 12px; }
    .catalog-nav-inner { height: 52px; padding: 0 12px; }
    .catalog-nav-links .nav-link { padding: 6px 8px; font-size: 11px; }
    .catalog-brand { font-size: 16px; }
    .nav-logo-img { width: 28px; height: 28px; }
    .catalog-filter-bar { gap: 6px; }
    .cat-filter-btn { padding: 6px 12px; font-size: 12px; }

    /* Cart drawer */
    .cart-drawer { width: 100%; right: -100%; }
    .cart-fab { bottom: 20px; right: 20px; width: 54px; height: 54px; font-size: 22px; }

    /* Items table in modal */
    .items-table { font-size: 11px; }
    .items-table th { padding: 8px 6px; font-size: 10px; }
    .items-table td { padding: 6px; }
    .items-table input, .items-table select { padding: 6px 8px; font-size: 13px; }
}

/* Small phones: under 400px */
@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 14px; }
    .catalog-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .product-thumb { height: 100px; }
    .product-info { padding: 10px; }
    .product-name { font-size: 12px; }
    .product-price { font-size: 14px; }
    .login-card { padding: 28px 20px; }
    .page-header h1 { font-size: 18px; }
    .header-title { font-size: 14px; }
    .tab-btn { padding: 8px 12px; font-size: 11px; }
}

/* iOS safe area support */
@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar { padding-bottom: env(safe-area-inset-bottom); }
    .modal-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
    .cart-drawer-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
    .cart-fab { bottom: calc(20px + env(safe-area-inset-bottom)); }
    .catalog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* Touch-friendly: larger tap targets */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .sidebar-nav a { min-height: 44px; }
    .tab-btn { min-height: 44px; }
    .pagination button { min-height: 36px; min-width: 36px; }
    .modal-close { width: 36px; height: 36px; }
    tbody td { padding: 14px 12px; }
    .form-control { min-height: 44px; }
    .filter-input, .filter-select { min-height: 44px; }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .login-page { padding: 16px; }
    .login-card { max-width: 480px; padding: 24px; }
    .login-logo-img { width: 56px; height: 56px; }
    .login-logo { margin-bottom: 16px; }
    .catalog-hero { padding: 24px 16px; }
    .catalog-hero h1 { font-size: 20px; }
    .modal { max-height: 95vh; }
}

/* Dark mode support for status bar (iOS) */
@media (prefers-color-scheme: dark) {
    meta[name="theme-color"] { content: #1a0a0b; }
}

/* ===== CONTACT PAGE ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.contact-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,.04);
    transition: var(--transition);
}
.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.contact-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.contact-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: var(--dark);
}
.contact-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}
.contact-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.contact-card a:hover {
    text-decoration: underline;
}
.contact-form-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,.04);
}
.contact-map-section {
    margin-top: 20px;
    margin-bottom: 40px;
}
.contact-map {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ── Finishing touches ───────────────────────────────────── */
code {
    background: #f5f5f4; padding: 2px 8px; border-radius: 6px;
    font-size: 12px; font-weight: 600; color: var(--primary-dark);
    border: 1px solid rgba(0,0,0,.06); font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.2); }

/* Selection */
::selection { background: rgba(220,38,38,.15); color: var(--text); }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Focus ring */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Loading skeleton shimmer */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f5f5f4 25%, #e7e5e4 50%, #f5f5f4 75%);
    background-size: 400px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
