/* Homepage Admin styling — Swiss / eco-green. Self-contained, NO shadows,
   hairline borders, sharp corners. Shares the homepage's brand tokens but is a
   separate stylesheet (admin only — not the public page, not the webshop). */

:root {
    --green:       #78d850;
    --green-hover: #66c93f;
    --green-deep:  #2f7a27;
    --green-tint:  #f1f8ec;
    --ink:         #111613;
    --ink-soft:    #5b635e;
    --band:        #f4f7f2;
    --line:        #e4e8e2;
    --line-strong: #cfd6ce;
    --white:       #ffffff;
    --danger:      #b3261e;
    --danger-tint: #fbe7e5;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--band);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

.muted { color: var(--ink-soft); }

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    color: var(--ink);
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); }
.topbar .brand .logo-iam { color: var(--green); }
.topbar nav a { color: var(--ink); margin-left: 20px; font-weight: 600; font-size: 14px; }
.topbar nav a:hover { color: var(--green-deep); text-decoration: none; }

/* Layout */
.wrap { max-width: 980px; margin: 28px auto; padding: 0 24px; }
.wrap.narrow { max-width: 640px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }

/* Buttons */
.btn {
    display: inline-block;
    background: var(--white);
    color: var(--ink);
    border: 1.5px solid var(--ink);
    border-radius: 2px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    font-family: inherit;
}
.btn:hover { background: var(--ink); color: var(--white); text-decoration: none; }
.btn-primary { background: var(--green); color: var(--ink); border-color: var(--green); }
.btn-primary:hover { background: var(--green-hover); color: var(--ink); border-color: var(--green-hover); }
.btn-danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-mini { padding: 2px 8px; font-size: 11px; line-height: 1.5; }

/* Table */
table.grid {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    margin-top: 18px;
    border: 1px solid var(--line);
}
table.grid th, table.grid td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
table.grid tr:last-child td { border-bottom: none; }
table.grid th {
    background: var(--band);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-soft);
    font-weight: 700;
}
.actions a { margin-right: 6px; }
.inline { display: inline; }
.order-no { display: inline-block; min-width: 20px; font-weight: 700; }
.thumb { height: 44px; width: 44px; object-fit: contain; background: var(--band); border: 1px solid var(--line); }

/* Status badge buttons */
.badge { border: 1px solid transparent; cursor: pointer; border-radius: 2px; padding: 4px 12px; font-size: 12px; font-weight: 700; font-family: inherit; }
.badge-on  { background: var(--green-tint); color: var(--green-deep); border-color: var(--green); }
.badge-off { background: var(--band); color: var(--ink-soft); border-color: var(--line-strong); }

/* Style pill */
.pill { border-radius: 2px; padding: 3px 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-strong); background: var(--white); }
.pill.card-light  { background: var(--band); }
.pill.card-blue   { background: var(--green-tint); color: var(--green-deep); border-color: var(--green); }
.pill.card-yellow { background: var(--band); }
.pill.card-orange { background: var(--band); }

/* Forms */
form label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 14px; }
form input[type=text], form input[type=password], form input[type=number],
form textarea, form select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 2px;
    font: inherit; font-weight: 400; background: var(--white); color: var(--ink);
}
form input[type=text]:focus, form input[type=password]:focus, form input[type=number]:focus,
form textarea:focus, form select:focus {
    outline: none; border-color: var(--green); box-shadow: none;
}
form input[type=file] { margin-top: 6px; }
fieldset { border: 1px solid var(--line); border-radius: 2px; margin: 18px 0; padding: 10px 16px 16px; background: var(--white); }
legend { font-weight: 700; padding: 0 6px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.inline-check { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.inline-check.standalone { margin-top: 28px; }
.inline-check input { width: auto; }
.current-image { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.tile-block { border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px; margin: 12px 0; background: var(--white); }
.tile-block strong { display: block; margin-bottom: 6px; }
.form-actions { margin-top: 22px; display: flex; gap: 10px; }

/* Alerts */
.alert { padding: 11px 14px; border-radius: 2px; margin: 14px 0; border: 1px solid transparent; font-size: 14px; }
.alert-error { background: var(--danger-tint); color: var(--danger); border-color: #f0b8b3; }
.alert-ok { background: var(--green-tint); color: var(--green-deep); border-color: var(--green); }
.alert ul { margin: 0; padding-left: 18px; }

/* Login */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--band); }
.login-card { background: var(--white); padding: 32px; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 2px; width: 340px; }
.login-card h1 { margin: 0 0 2px; font-size: 20px; font-weight: 800; }
.login-card h1 .logo-iam { color: var(--green); }
.login-card .muted { margin: 0 0 18px; }
.login-card .btn { width: 100%; margin-top: 18px; }

/* Active nav link */
.topbar nav a.active { color: var(--green-deep); font-weight: 700; }

/* Section list (layout manager) */
.sec-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 2px; padding: 12px 14px; }
.sec-row.is-hidden { border-left-color: var(--line-strong); opacity: .6; }
.sec-main { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex-wrap: wrap; }
.sec-type { font-weight: 700; font-size: 14px; }
.sec-title { color: var(--ink-soft); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.sec-badge { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.sec-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sec-actions form { margin: 0; }
.ibtn { display: inline-flex; align-items: center; gap: 4px; background: var(--white); border: 1px solid var(--line-strong); color: var(--ink); border-radius: 2px; padding: 6px 10px; font-size: 13px; cursor: pointer; text-decoration: none; }
.ibtn:hover { border-color: var(--green); text-decoration: none; }
.ibtn:disabled { opacity: .35; cursor: default; }
.ibtn-danger:hover { border-color: var(--danger); color: var(--danger); }
.add-section { display: flex; align-items: flex-end; gap: 12px; background: var(--white); border: 1px dashed var(--line-strong); border-radius: 2px; padding: 14px; }
.add-section label { margin: 0; }

/* Repeatable rows (section editor) */
.rep-row { border: 1px solid var(--line); border-radius: 4px; padding: 0; margin: 18px 0; background: var(--white); overflow: hidden; }
.rep-row > label, .rep-row > .btn-row { display: block; margin: 12px 16px; }
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; background: #f4f7f2; border-bottom: 1px solid var(--line); }
.rep-title { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; }
.rep-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.18); display: inline-block; flex: none; }
.rep-del { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: #b3261e; cursor: pointer; }
.rep-del input { accent-color: #b3261e; }
.rep-new { border-style: dashed; }
.rep-new .rep-head { background: #fff; color: var(--ink-soft, #5b635e); }
.rep-actions { display: inline-flex; align-items: center; gap: 18px; }
.rep-hide { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-soft, #5b635e); cursor: pointer; }
.rep-row.is-hidden > label, .rep-row.is-hidden > .btn-row { opacity: .5; }
.rep-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #e4e8e2; color: #5b635e; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.btn-add { margin-top: 6px; }
.rep-discard { background: none; border: none; color: #b3261e; font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; }

/* Checkbox label */
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }

/* Color editor */
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 18px 0; }
.color-item label { font-size: 13px; font-weight: 600; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); cursor: pointer; }
.color-row input[type=text] { flex: 1; }
