/* =============================================
   GIDA DEPO TAKİP — Mobile-First style.css
   ============================================= */

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

:root {
    --clr-bg:       #f4f6f9;
    --clr-surface:  #ffffff;
    --clr-border:   #e2e8f0;
    --clr-text:     #1e293b;
    --clr-muted:    #64748b;
    --clr-primary:  #2563eb;
    --clr-primary-h:#1d4ed8;
    --clr-danger:   #dc2626;
    --clr-danger-h: #b91c1c;
    --clr-ok:       #16a34a;
    --clr-warn:     #d97706;
    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 1px 4px rgba(0,0,0,.08);
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--clr-bg);
    color: var(--clr-text);
    font-size: 15px;
    line-height: 1.6;
}

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

/* ---- Topbar ---- */
.topbar {
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.topbar-brand h1 { font-size: 1rem; font-weight: 700; color: var(--clr-primary); }
.topbar-brand p  { font-size: .72rem; color: var(--clr-muted); display: none; }
.main-content { flex: 1; padding: 14px 12px; max-width: 1280px; margin: 0 auto; width: 100%; }
.top-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Flash ---- */
.flash {
    background: #dbeafe; border: 1px solid #93c5fd; color: #1e40af;
    padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .875rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 16px; border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 500; text-decoration: none;
    border: none; cursor: pointer; transition: background .15s; white-space: nowrap;
    min-height: 44px; min-width: 44px;
}
.btn-primary  { background: var(--clr-primary);  color: #fff; }
.btn-primary:hover { background: var(--clr-primary-h); }
.btn-danger   { background: var(--clr-danger);   color: #fff; }
.btn-danger:hover  { background: var(--clr-danger-h); }
.btn-light    { background: var(--clr-border);   color: var(--clr-text); }
.btn-light:hover   { background: #cbd5e1; }
.btn-full { width: 100%; }

/* ---- Panel ---- */
.panel {
    background: var(--clr-surface); border: 1px solid var(--clr-border);
    border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
}
.section-head h3 { font-size: 1rem; font-weight: 600; }

/* ---- Stats ---- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card {
    background: var(--clr-surface); border: 1px solid var(--clr-border);
    border-radius: var(--radius); padding: 14px 12px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 4px;
}
.stat-card span  { font-size: .72rem; color: var(--clr-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-card strong{ font-size: 1.6rem; font-weight: 700; color: var(--clr-primary); }

/* ---- Search ---- */
.search-grid { display: flex; flex-direction: column; gap: 10px; }
.search-grid input,
.search-grid select {
    width: 100%; padding: 12px 14px; border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm); font-size: 16px; background: var(--clr-bg);
    -webkit-appearance: none; appearance: none;
}
.search-grid .btn { width: 100%; }

/* ---- Product Grid — horizontal card on mobile ---- */
.product-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.product-card {
    background: var(--clr-surface); border: 1px solid var(--clr-border);
    border-radius: var(--radius); overflow: hidden; text-decoration: none;
    color: inherit; display: flex; flex-direction: row;
    box-shadow: var(--shadow); align-items: stretch;
}
.product-card:active { opacity: .9; }
.product-card img { width: 110px; min-width: 110px; object-fit: cover; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.card-body p { font-size: .82rem; color: var(--clr-muted); }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.card-title-row h2,
.card-title-row h3 { font-size: .95rem; font-weight: 600; line-height: 1.3; }
.meta-list { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.meta-list span { font-size: .75rem; color: var(--clr-muted); }

/* ---- Pills ---- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.pill.ok      { background: #dcfce7; color: var(--clr-ok); }
.pill.warn    { background: #fef3c7; color: var(--clr-warn); }
.pill.danger  { background: #fee2e2; color: var(--clr-danger); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 480px; }
thead th {
    background: var(--clr-bg); padding: 10px 12px; text-align: left;
    font-size: .75rem; font-weight: 600; color: var(--clr-muted);
    text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--clr-border);
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--clr-border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions .btn { min-height: 36px; padding: 6px 12px; }

/* ---- Forms ---- */
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: .875rem; font-weight: 500; }
.stack-form input,
.stack-form select,
.stack-form textarea {
    padding: 12px 14px; border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm); font-size: 16px; font-family: inherit;
    background: var(--clr-bg); transition: border-color .15s;
    -webkit-appearance: none; appearance: none; width: 100%;
}
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus { outline: none; border-color: var(--clr-primary); background: #fff; }
.stack-form button[type="submit"] { width: 100%; font-size: 1rem; padding: 13px; }

/* ---- Auth ---- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 70vh; padding: 16px; }
.auth-card {
    background: var(--clr-surface); border: 1px solid var(--clr-border);
    border-radius: var(--radius); padding: 28px 20px; width: 100%; max-width: 400px;
    box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px;
}
.auth-card h2 { font-size: 1.2rem; }
.auth-card p  { font-size: .875rem; color: var(--clr-muted); }
.error-box {
    background: #fee2e2; border: 1px solid #fca5a5; color: var(--clr-danger);
    padding: 10px 14px; border-radius: var(--radius-sm); font-size: .875rem;
}

/* ---- Detail ---- */
.detail-layout { display: flex; flex-direction: column; gap: 14px; }
.hero-grid { display: flex; flex-direction: column; gap: 16px; }
.hero-image { width: 100%; border-radius: var(--radius-sm); object-fit: cover; max-height: 240px; }
.lead { color: var(--clr-muted); font-size: .9rem; margin-top: 4px; }
.description { color: var(--clr-muted); font-size: .875rem; margin-top: 8px; line-height: 1.7; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.info-card {
    background: var(--clr-bg); border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm); padding: 10px 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.info-card span  { font-size: .72rem; color: var(--clr-muted); text-transform: uppercase; }
.info-card strong{ font-size: .95rem; font-weight: 600; }

/* ---- Admin ---- */
.admin-layout { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }

/* ---- Empty ---- */
.empty-box { text-align: center; color: var(--clr-muted); padding: 32px 16px; font-size: .9rem; }

/* ---- Bottom Nav (mobil) ---- */
.bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--clr-surface); border-top: 1px solid var(--clr-border);
    z-index: 200; box-shadow: 0 -2px 8px rgba(0,0,0,.06);
    /* iPhone safe area */
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 10px 4px; text-decoration: none;
    color: var(--clr-muted); font-size: .68rem; font-weight: 500; gap: 3px;
    min-height: 56px; transition: color .15s;
}
.bottom-nav a.active { color: var(--clr-primary); }
.bottom-nav a svg {
    width: 22px; height: 22px; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* bottom nav için içerik boşluğu */
.main-content { padding-bottom: 80px; }

/* ---- Tablet+ ---- */
@media (min-width: 600px) {
    .topbar { padding: 14px 24px; }
    .topbar-brand p { display: block; }
    .main-content { padding: 20px 24px 20px; }

    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .product-card { flex-direction: column; }
    .product-card img { width: 100%; height: 160px; min-width: unset; }

    .search-grid { flex-direction: row; }
    .search-grid input,
    .search-grid select { flex: 1; width: auto; }
    .search-grid .btn { width: auto; }

    .bottom-nav { display: none; }
    .admin-layout { flex-direction: row; }
    .admin-layout > .panel { flex: 1; }
}

@media (min-width: 900px) {
    .main-content { padding: 24px 32px; }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-grid { flex-direction: row; align-items: start; }
    .hero-image { width: 45%; max-height: 320px; }
    .stat-card strong { font-size: 1.9rem; }
}
