/* Asset Portal — wireframe styles. Low-fidelity, layout-focused. */

:root {
    --primary: #0E4F6E;
    --primary-dark: #093a52;
    --accent-bg: #E6F4FA;
    --surface: #ffffff;
    --border: #d8e1e8;
    --border-strong: #b6c4cf;
    --text: #1f2d36;
    --text-muted: #5b6b78;
    --ok: #1a7f4b;
    --ok-bg: #e0f3e8;
    --warn: #a06400;
    --warn-bg: #fcefd2;
    --bad: #b3261e;
    --bad-bg: #fbe3e1;
    --neutral: #5b6b78;
    --neutral-bg: #eceff2;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--accent-bg);
    font-size: 14px;
    line-height: 1.45;
}

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

h1, h2, h3, h4 { margin: 0 0 12px; color: var(--text); }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }

/* ====== Header ====== */
.header {
    background: var(--primary);
    color: #fff;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.header .brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 3px;
}
.header nav { display: flex; gap: 20px; flex: 1; }
.header nav a {
    color: #fff;
    opacity: 0.85;
    font-size: 14px;
    padding: 6px 4px;
}
.header nav a.active { opacity: 1; border-bottom: 2px solid #fff; }
.header nav a:hover { opacity: 1; text-decoration: none; }

.header .search {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    width: 240px;
    font-size: 13px;
}
.header .search::placeholder { color: rgba(255,255,255,0.7); }

.header .icon-btn {
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    position: relative;
}
.header .icon-btn:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.header .cart-badge {
    background: #fff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 7px;
    margin-left: 4px;
}

/* ====== Page shell ====== */
.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px 80px;
}
.crumb {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}
.crumb a { color: var(--primary); }
.crumb .sep { margin: 0 6px; color: var(--border-strong); }

.section { background: var(--surface); border-radius: 6px; padding: 20px; margin-bottom: 20px; border: 1px solid var(--border); }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.section-title a { font-size: 13px; font-weight: 400; }

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 4px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--primary); }
.btn.secondary:hover { background: var(--accent-bg); }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn.small { padding: 5px 12px; font-size: 12px; }

/* ====== Asset grid ====== */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}
.asset-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
}
.asset-card:hover { box-shadow: 0 4px 14px rgba(14,79,110,0.12); transform: translateY(-2px); }
.asset-card .img {
    aspect-ratio: 1.4 / 1;
    background: linear-gradient(135deg, #d0e3ee 0%, #b1cfdf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(14,79,110,0.4);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.asset-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.asset-card .body h4 { margin: 0 0 4px; font-size: 14px; }
.asset-card .body .meta { color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.asset-card .body .footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

/* ====== Badge / pill ====== */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.2px;
}
.badge.ok    { background: var(--ok-bg);      color: var(--ok); }
.badge.warn  { background: var(--warn-bg);    color: var(--warn); }
.badge.bad   { background: var(--bad-bg);     color: var(--bad); }
.badge.muted { background: var(--neutral-bg); color: var(--neutral); }

/* ====== Filters sidebar ====== */
.layout-with-sidebar { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.filter-group { margin-bottom: 18px; }
.filter-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 8px; }
.filter-group label { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; cursor: pointer; }

/* ====== Tables ====== */
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
table.data th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
table.data tr:hover td { background: var(--accent-bg); }
table.data tr.clickable { cursor: pointer; }

/* ====== Forms ====== */
.form-row { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center; margin: 12px 0; }
.form-row.stacked { display: block; }
.form-row.stacked label { display: block; margin-bottom: 6px; }
label.field-label { font-size: 13px; color: var(--text-muted); }
label.field-label .req { color: var(--bad); }
input[type="text"], input[type="date"], input[type="datetime-local"], input[type="number"], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font: inherit;
    background: #fff;
}
textarea { min-height: 70px; resize: vertical; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.hint .ico { color: var(--primary); margin-right: 4px; }

/* ====== Cart line items ====== */
.cart-list { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cart-line { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); align-items: center; }
.cart-line:last-child { border-bottom: none; }
.cart-line .thumb { width: 90px; aspect-ratio: 1.4 / 1; background: linear-gradient(135deg, #d0e3ee 0%, #b1cfdf 100%); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: rgba(14,79,110,0.4); font-size: 10px; text-transform: uppercase; }
.cart-line h4 { margin: 0 0 4px; font-size: 14px; }
.cart-line .meta { color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }
.cart-line .controls { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cart-line .actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.qty-stepper button { background: #fff; border: none; padding: 4px 10px; cursor: pointer; font-size: 14px; color: var(--primary); }
.qty-stepper button:hover { background: var(--accent-bg); }
.qty-stepper input { width: 38px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 4px 0; }

/* ====== Status timeline ====== */
.timeline { display: flex; align-items: center; gap: 0; margin: 12px 0 8px; }
.timeline .step { flex: 1; text-align: center; position: relative; font-size: 12px; color: var(--text-muted); }
.timeline .step::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--border-strong); margin: 0 auto 6px; position: relative; z-index: 1; }
.timeline .step.done::before { background: var(--ok); border-color: var(--ok); }
.timeline .step.current::before { background: var(--primary); border-color: var(--primary); }
.timeline .step.done, .timeline .step.current { color: var(--text); font-weight: 500; }
.timeline .step + .step::after { content: ""; position: absolute; top: 7px; left: -50%; right: 50%; height: 2px; background: var(--border-strong); z-index: 0; }
.timeline .step.done + .step::after, .timeline .step.current + .step::after { background: var(--ok); }

/* ====== Comments ====== */
.comment-list { margin-bottom: 16px; }
.comment { padding: 12px 14px; border-left: 3px solid var(--primary); background: var(--accent-bg); margin-bottom: 10px; border-radius: 0 4px 4px 0; }
.comment .who { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.comment .who strong { color: var(--text); }

/* ====== Misc ====== */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; }
.row-end { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.pagination a { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--primary); font-size: 13px; }
.pagination a.current { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.success-state { text-align: center; padding: 60px 20px; }
.success-state .check { width: 60px; height: 60px; border-radius: 50%; background: var(--ok); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 18px; }

.note-banner { background: #fff5d6; border: 1px solid #f0d28a; border-left: 4px solid #d49b1a; padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 18px; color: #7a5b0d; }

/* ====== Item detail ====== */
.item-detail { display: grid; grid-template-columns: 360px 1fr; gap: 32px; align-items: start; }
.item-gallery .main-img { aspect-ratio: 1.4 / 1; background: linear-gradient(135deg, #d0e3ee 0%, #b1cfdf 100%); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: rgba(14,79,110,0.4); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.item-gallery .thumbs { display: flex; gap: 8px; }
.item-gallery .thumb { width: 64px; aspect-ratio: 1.4 / 1; background: linear-gradient(135deg, #d0e3ee 0%, #b1cfdf 100%); border-radius: 4px; cursor: pointer; opacity: 0.7; }
.item-gallery .thumb.active, .item-gallery .thumb:hover { opacity: 1; outline: 2px solid var(--primary); }

/* ====== Wireframe index ====== */
.wf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }
.wf-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 18px; transition: box-shadow 0.15s; }
.wf-card:hover { box-shadow: 0 4px 14px rgba(14,79,110,0.12); }
.wf-card h3 { font-size: 15px; margin-bottom: 4px; }
.wf-card .route { font-family: monospace; color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }
.wf-card p { color: var(--text-muted); font-size: 13px; margin: 0 0 12px; }
.wf-card a { font-size: 13px; font-weight: 500; }

/* ====== Responsive ====== */
@media (max-width: 720px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .item-detail { grid-template-columns: 1fr; }
    .header { padding: 0 14px; gap: 12px; }
    .header .search { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 1fr; }
}
