* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, Arial, sans-serif;
    background: #f4f5f7;
    color: #1c1c1e;
    padding-bottom: 70px;
}

header {
    background: #1b7f4b;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
header h1 { margin: 0; font-size: 20px; }
.hbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.hbtns button {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

main { padding: 12px 16px; max-width: 600px; margin: 0 auto; }
h2 { font-size: 16px; margin: 18px 0 8px; }

.card {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.summary strong { font-size: 24px; display: block; margin-top: 4px; }
.summary small { display: block; color: #6b6b70; font-size: 13px; margin-top: 4px; }

.row {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.row small { display: block; color: #6b6b70; font-size: 12px; margin-top: 2px; }

.product-btn {
    width: 100%;
    border: none;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    color: #1c1c1e;
}

input {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

button {
    background: #1b7f4b;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    cursor: pointer;
}
form button { width: 100%; }
button.secondary { background: #e3e3e6; color: #1c1c1e; }
button.small { padding: 6px 10px; font-size: 13px; }
button.danger { background: #c0392b; }

.actions-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.empty { color: #6b6b70; font-size: 14px; }
.muted { color: #6b6b70; font-size: 13px; }
.low { color: #c0392b; font-weight: bold; }
.good { color: #1b7f4b; }
.bad { color: #c0392b; }
.hidden { display: none; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

button.notice {
    width: 100%;
    text-align: left;
    background: #fff4d6;
    color: #5c4400;
    border-left: 4px solid #e0a100;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 10px;
}
.dialog p { margin: 8px 0; }
.dialog .stack { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.dialog .stack button, .dialog .filebtn { width: 100%; }
.filebtn {
    display: block;
    background: #e3e3e6;
    color: #1c1c1e;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
}
.filebtn input { display: none; }
.warnbox { background: #fdecea; color: #8a1f11; border-radius: 8px; padding: 10px 12px; font-size: 14px; }

.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 16px; }
.check input { width: 22px; height: 22px; margin: 0; }

.seg { display: flex; gap: 6px; margin-bottom: 10px; }
.seg button { flex: 1; padding: 10px 6px; font-size: 14px; background: #e3e3e6; color: #1c1c1e; }
.seg button.on { background: #1b7f4b; color: white; }

.stat {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.stat:last-child { border-bottom: none; }

nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: white;
    border-top: 1px solid #ddd;
}
nav button {
    flex: 1;
    background: none;
    color: #6b6b70;
    border-radius: 0;
    padding: 16px 2px;
    font-size: 13px;
}
nav button.active { color: #1b7f4b; font-weight: bold; border-top: 3px solid #1b7f4b; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 10;
}
.dialog {
    background: white;
    width: 100%; max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    padding: 20px;
}
.dialog h2 { margin-top: 0; font-size: 20px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 16px 0; }
.stepper button { width: 56px; height: 56px; font-size: 28px; padding: 0; }
.stepper span { font-size: 32px; min-width: 50px; text-align: center; }
.dialog .actions { display: flex; gap: 10px; margin-top: 10px; }
.dialog .actions button { flex: 1; }