/* =====================================================================
   Fuse Concierge — Admin stylesheet
   Desktop/laptop back office. Clean, dense, professional. Shares the
   Fuse navy + amber palette with the kiosk but tuned for data entry.
   ===================================================================== */

:root {
    --navy:      #0b2541;
    --navy-700:  #13314f;
    --accent:    #ec7c82;
    --accent-700:#c85a61;
    --bg:        #eef1f5;
    --card:      #ffffff;
    --ink:       #11151c;
    --ink-soft:  #5a6472;
    --line:      #dbe1ea;
    --good:      #2e8b57;
    --good-bg:   #e7f4ec;
    --err:       #b3261e;
    --err-bg:    #fdecec;
    --info-bg:   #eaf1fb;
    --radius:    12px;
    --shadow:    0 2px 10px rgba(11,37,65,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.admin {
    font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.45;
}

/* ---- Top bar -------------------------------------------------------- */
.admin-top {
    background: var(--navy);
    color: #fff;
    box-shadow: var(--shadow);
}
.admin-top-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-brand {
    color: #fff; text-decoration: none;
    font-weight: 800; font-size: 19px; letter-spacing: 0.3px;
}
.admin-brand span { color: var(--accent); font-weight: 600; }
.admin-brand em { font-style: normal; font-weight: 400; opacity: 0.7; font-size: 14px; margin-left: 4px; }
.admin-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    margin-left: 22px;
    font-size: 14px;
    font-weight: 600;
}
.admin-nav a:hover { color: #fff; }

/* ---- Main ----------------------------------------------------------- */
.admin-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

/* ---- Page header ---------------------------------------------------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.page-head h1 { font-size: 26px; margin: 0; color: var(--navy); }
.page-head .sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.crumb { font-size: 13px; margin-bottom: 6px; }
.crumb a { color: var(--accent-700); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ---- Cards ---------------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}
.card h2 { font-size: 17px; margin: 0 0 16px; color: var(--navy); }
.card h2.with-action { display: flex; align-items: center; justify-content: space-between; }

/* ---- Grid of building tiles ----------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--ink);
    display: block;
    transition: border-color 120ms, transform 120ms;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile .tname { font-size: 17px; font-weight: 700; color: var(--navy); }
.tile .taddr { font-size: 13px; color: var(--ink-soft); margin: 4px 0 14px; }
.tile .tstats { display: flex; gap: 18px; font-size: 13px; color: var(--ink-soft); }
.tile .tstats b { display: block; font-size: 19px; color: var(--navy); }
.tile.inactive { opacity: 0.6; }

/* ---- Tables --------------------------------------------------------- */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-soft); }
table.grid tr:last-child td { border-bottom: none; }
table.grid .muted { color: var(--ink-soft); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.on  { background: var(--good-bg); color: var(--good); }
.badge.off { background: #f0f0f0; color: #888; }
.badge.amber { background: #fde3e5; color: var(--accent-700); }
.pill { display:inline-block; font-size: 11px; font-weight:700; padding:2px 8px; border-radius:6px; background:#eef1f5; color:var(--ink-soft); margin-right:4px;}
.pill.active { background: var(--accent); color: var(--navy); }

/* ---- Forms ---------------------------------------------------------- */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 200px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=time], .field input[type=date], .field input[type=number], .field textarea, .field select {
    width: 100%; padding: 10px 12px; font-size: 15px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    font-family: inherit; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(236,124,130,0.18);
}
.field textarea { min-height: 80px; resize: vertical; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.check .check-label b { display: block; color: var(--navy); }
.check .check-label span { color: var(--ink-soft); font-size: 13px; }

/* ---- Buttons -------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 18px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: background 120ms, transform 100ms;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-primary:hover { background: var(--accent-700); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--err-bg); color: var(--err); }
.btn-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ---- Flash ---------------------------------------------------------- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.flash-success { background: var(--good-bg); color: var(--good); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--info-bg); color: var(--navy); }

/* ---- Login ---------------------------------------------------------- */
.login-wrap { max-width: 380px; margin: 8vh auto 0; }
.login-wrap .card { padding: 28px; }
.login-wrap h1 { font-size: 22px; color: var(--navy); margin: 0 0 4px; }
.login-wrap .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 22px; }

/* ---- Misc ----------------------------------------------------------- */
.kiosk-link { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; background: #f4f6f9; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; word-break: break-all; color: var(--navy); }
.empty-note { color: var(--ink-soft); font-size: 14px; padding: 14px 0; }
.admin-foot { text-align: center; color: var(--ink-soft); font-size: 12px; padding: 24px; }
details.inline-form > summary { cursor: pointer; color: var(--accent-700); font-weight: 700; font-size: 14px; list-style: none; }
details.inline-form > summary::-webkit-details-marker { display: none; }
details.inline-form[open] > summary { margin-bottom: 14px; }
.notify-flags { font-size: 12px; }
@media (max-width: 640px) {
    .page-head { flex-direction: column; align-items: flex-start; }
    table.grid { font-size: 13px; }
    table.grid th:nth-child(n+4), table.grid td:nth-child(n+4) { display: none; }
}

/* ---- Manager building switcher -------------------------------------- */
.building-switch { display: inline-flex; align-items: center; margin-right: 14px; }
.building-switch select {
    padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; font-weight: 600; color: var(--navy); max-width: 220px;
}
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
