/* Explore Trailer Hub - shared stylesheet
   Brand: purple #53277C, gold #FFC000, font Arial. */

:root {
    --brand: #53277C;
    --brand-dark: #3a1a59;
    --accent: #FFC000;
    --bg: #f5f5f7;
    --card: #ffffff;
    --ink: #1c1c1e;
    --muted: #6b6b72;
    --line: #e5e5ea;
    --good: #1f7a3a;
    --warn: #b8860b;
    --bad:  #b3261e;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

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

.topbar {
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-bottom: 4px solid var(--accent);
}
.topbar .brand a { color:#fff; display:flex; align-items:baseline; gap:8px; }
.brand-mark { font-weight: 800; letter-spacing:.5px; }
.brand-mark.big { font-size: 28px; }
.brand-sub  { color: #fff; opacity:.85; }
.topnav a {
    color:#fff; padding: 6px 10px; border-radius:6px; margin-left: 4px;
}
.topnav a:hover { background: var(--brand-dark); text-decoration:none; }
.topnav .logout { background: var(--accent); color: var(--brand); font-weight:700; }
.user-chip {
    background: rgba(255,255,255,.15); padding: 4px 8px; border-radius: 12px;
    margin: 0 8px; font-size: 13px;
}

.page { max-width: 1200px; margin: 16px auto; padding: 0 16px; }
.footbar { text-align:center; padding: 16px; color: var(--muted); }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; color: var(--brand); }
.card h3 { margin: 0 0 8px; color: var(--brand); }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* KPI tiles */
.kpi {
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    padding: 14px; display:flex; flex-direction:column; gap:6px;
}
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 700; color: var(--brand); }

/* Forms */
form label { display:block; margin: 10px 0; font-size: 14px; color: var(--ink); }
form input[type=text], form input[type=password], form input[type=number],
form input[type=email], form input[type=date], form select, form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 8px; font-size: 16px; background: #fff;
}
form textarea { min-height: 80px; }
.btn {
    display:inline-block; padding: 10px 14px; border-radius: 8px;
    border: 1px solid var(--brand); background: #fff; color: var(--brand);
    font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--brand); color:#fff; }
.btn.primary { background: var(--brand); color:#fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.accent { background: var(--accent); color: var(--brand); border-color: var(--accent); }
.btn.danger { background:#fff; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad); color:#fff; }
.btn.small { padding: 6px 10px; font-size: 13px; }

/* Tables */
.table-wrap { overflow-x:auto; }
table.data {
    width: 100%; border-collapse: collapse; background:#fff;
}
table.data th, table.data td {
    padding: 8px 10px; text-align:left; border-bottom: 1px solid var(--line);
    font-size: 14px; vertical-align: top;
}
table.data th {
    background: #f0eaf6; color: var(--brand);
}
table.data tr:hover td { background: #fafafa; }

/* Status pills */
.pill {
    display:inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
}
.pill.loaded   { background: #e8f5ec; color: var(--good); }
.pill.unloaded { background: #f3f3f5; color: var(--muted); }
.pill.valid    { background: #e8f5ec; color: var(--good); }
.pill.expired  { background: #fdecec; color: var(--bad); }
.pill.unknown  { background: #fff3d9; color: var(--warn); }
.pill.adhoc    { background: #f3eaff; color: var(--brand); }

/* Alerts */
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.alert.info  { background: #e9f2fb; color: #154d80; }
.alert.ok    { background: #e8f5ec; color: var(--good); }
.alert.error { background: #fdecec; color: var(--bad); }

/* Login */
.login-shell {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    min-height: 100vh; display:flex; align-items:center; justify-content:center;
}
.login-card {
    background:#fff; padding: 28px; border-radius: 14px; width: min(420px, 92%);
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.brand-large { text-align:center; margin-bottom: 18px; color: var(--brand); }
.brand-large .brand-mark { display:block; }
.hint { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* Mobile shell tweaks */
.mobile-shell .topnav a { font-size: 14px; padding: 4px 6px; }
.mobile-shell .page { padding: 0 10px; }
.mobile-shell .kpi .value { font-size: 22px; }
.bigbtn {
    display:block; width:100%; padding: 16px; margin: 8px 0;
    border-radius: 12px; font-size: 18px;
    background: var(--brand); color:#fff; text-align:center; font-weight: 700;
}
.bigbtn.accent { background: var(--accent); color: var(--brand); }
.bigbtn:hover { text-decoration:none; }

/* Photo previews */
.photo-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:6px; margin-top: 8px; }
.photo-grid img { width:100%; height: 100px; object-fit: cover; border-radius: 6px; }

/* Filters bar */
.filters { display:flex; flex-wrap:wrap; gap:8px; align-items:end; margin-bottom: 12px; }
.filters label { margin: 0; flex: 1; min-width: 160px; }

@media (max-width: 720px) {
    .topbar { flex-direction: column; align-items: stretch; gap: 6px; }
    .topnav { display:flex; flex-wrap:wrap; gap:4px; }
    .user-chip { display:none; }
}
