/* Fuse Installer Portal — app.css
   Brand: primary #0b2541, accent #ec7c82, deeper rose #c85a61 */

:root {
    --navy: #0b2541;
    --navy-2: #13314f;
    --navy-3: #1d4066;
    --pink: #ec7c82;
    --rose: #c85a61;
    --info-blue: #eaf1fb;
    --green: #2e8b57;
    --error: #b3261e;
    --ink: #1a2230;
    --muted: #5b6b80;
    --line: #d9e0ea;
    --bg: #f4f6fa;
    --white: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

/* ---- Topbar ---- */
.topbar {
    background: var(--navy);
    color: var(--white);
}
.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}
.brand { font-weight: 700; letter-spacing: .2px; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: #cdd9e8; text-decoration: none; font-size: 14px; }
.topnav a:hover { color: var(--white); }
.user-chip { font-size: 14px; color: #e6edf6; }
.user-chip .role {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--navy-3);
    color: #dce6f2;
    font-style: normal;
    font-size: 12px;
}
.topnav a.logout { color: var(--pink); }

/* ---- Layout ---- */
.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.page-title { margin: 0 0 4px; color: var(--navy); font-size: 24px; }
.muted { color: var(--muted); margin-top: 0; }

/* ---- Tiles ---- */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 22px;
}
.tile {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px 18px 16px;
}
.tile h2 { margin: 0 0 6px; font-size: 17px; color: var(--navy-2); }
.tile p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.tag {
    display: inline-block;
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 10px;
    background: var(--info-blue);
    color: var(--navy-3);
}
.tag-soon { background: #fbecee; color: var(--rose); }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--line); margin-top: 30px; }
.footer-inner {
    max-width: 1080px; margin: 0 auto; padding: 16px 20px;
    color: var(--muted); font-size: 13px;
}

/* ---- Login ---- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
    padding: 20px;
}
.login-card {
    background: var(--white);
    width: 100%;
    max-width: 380px;
    border-radius: 14px;
    padding: 32px 30px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-brand { margin: 0 0 4px; color: var(--navy); font-size: 22px; }
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; }
.login-form label { font-size: 13px; font-weight: 600; color: var(--navy-2); margin-bottom: 5px; }
.login-form input {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 15px;
}
.login-form input:focus { outline: 2px solid var(--navy-3); border-color: var(--navy-3); }

/* ---- Buttons ---- */
.btn {
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-2); }

/* ---- Alerts ---- */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fbeaea; color: var(--error); border: 1px solid #f1c9c7; }

/* ---- Tile as link (Bundle 2) ---- */
.tile-link { text-decoration: none; color: inherit; display: block; transition: border-color .12s, box-shadow .12s; }
.tile-link:hover { border-color: var(--navy-3); box-shadow: 0 4px 14px rgba(11,37,65,.10); }

/* ---- Filter bar ---- */
.filter-bar {
    display: flex; align-items: flex-end; gap: 14px;
    margin: 18px 0 16px; flex-wrap: wrap;
}
.filter-bar label { font-size: 13px; font-weight: 600; color: var(--navy-2); display: flex; flex-direction: column; gap: 4px; }
.filter-bar select {
    padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 14px; background: var(--white); min-width: 130px;
}
.btn-secondary { background: var(--navy-3); color: var(--white); }
.btn-secondary:hover { background: var(--navy-2); }

/* ---- Data table ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead th {
    text-align: left; padding: 11px 14px; background: #f0f4f9;
    color: var(--navy-2); font-weight: 600; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table tbody td { padding: 11px 14px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafcfe; }
.site-cell { max-width: 320px; }
.link { color: var(--navy-3); text-decoration: none; font-weight: 600; }
.link:hover { color: var(--rose); text-decoration: underline; }

/* ---- Badges ---- */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.badge-install  { background: var(--info-blue); color: var(--navy-3); }
.badge-removal  { background: #fbecee; color: var(--rose); }
.badge-pending  { background: #fdf3e3; color: #9a6700; }
.badge-complete { background: #e7f4ec; color: var(--green); }

/* ---- Empty state ---- */
.empty-state {
    padding: 28px; text-align: center; color: var(--muted);
    background: var(--white); border: 1px dashed var(--line); border-radius: 10px;
}

/* ---- Detail view ---- */
.breadcrumb { margin: 0 0 8px; }
.breadcrumb a { color: var(--navy-3); text-decoration: none; font-size: 14px; }
.breadcrumb a:hover { color: var(--rose); }
.detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-grid {
    margin-top: 18px; background: var(--white); border: 1px solid var(--line);
    border-radius: 10px; overflow: hidden;
}
.detail-row { display: grid; grid-template-columns: 220px 1fr; border-bottom: 1px solid #eef2f7; }
.detail-row:last-child { border-bottom: none; }
.detail-label { padding: 12px 16px; background: #f6f9fc; color: var(--navy-2); font-weight: 600; font-size: 13px; }
.detail-value { padding: 12px 16px; font-size: 14px; }
.detail-placeholder {
    margin-top: 22px; padding: 18px; background: var(--white);
    border: 1px solid var(--line); border-radius: 10px;
}
.detail-placeholder h2 { margin: 0 0 6px; font-size: 17px; color: var(--navy-2); }
@media (max-width: 560px) {
    .detail-row { grid-template-columns: 1fr; }
    .detail-label { border-bottom: 1px solid #eef2f7; }
}

/* ---- Flash / alert ok ---- */
.alert-ok { background: #e7f4ec; color: var(--green); border: 1px solid #bfe3cc; }

/* ---- Photos section (Bundle 3) ---- */
.photos-section { margin-top: 22px; }
.photos-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.photos-head h2 { margin: 0; font-size: 18px; color: var(--navy-2); }
.upload-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-form input[type=file] { font-size: 13px; }

.photo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.photo-card {
    margin: 0; background: var(--white); border: 1px solid var(--line);
    border-radius: 10px; overflow: hidden; display: flex; flex-direction: column;
}
.photo-card img { width: 100%; height: 150px; object-fit: cover; display: block; background: #eef2f7; }
.photo-card figcaption { padding: 8px 10px; font-size: 12px; color: var(--muted); word-break: break-word; }
.photo-del { padding: 0 10px 10px; }
.btn-link-danger { background: none; border: none; color: var(--error); font-size: 13px; cursor: pointer; padding: 0; font-weight: 600; }
.btn-link-danger:hover { text-decoration: underline; }
.btn-link { background: none; border: none; color: var(--navy-3); font-size: 13px; cursor: pointer; padding: 0; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

/* ---- Complete ---- */
.complete-form { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.btn-complete { background: var(--green); color: var(--white); }
.btn-complete:hover { background: #256f46; }
.btn-complete:disabled { background: #a9c9b6; cursor: not-allowed; }
.complete-banner {
    margin-top: 20px; padding: 12px 16px; background: #e7f4ec; color: var(--green);
    border: 1px solid #bfe3cc; border-radius: 8px; font-weight: 600;
}

/* ---- Recipients ---- */
.recipient-add { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.recipient-add input {
    padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.recipient-add input[type=email] { min-width: 240px; }
.row-actions { display: flex; gap: 14px; align-items: center; }
.row-actions form { display: inline; }

/* ---- Photographic record (Bundle 4) ---- */
.photos-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.record-controls { display: flex; gap: 20px; flex-wrap: wrap; margin: 18px 0; }
.stamp-default { flex: 1 1 360px; display: flex; flex-direction: column; gap: 6px; }
.stamp-default span, .layout-choose span { font-size: 13px; font-weight: 600; color: var(--navy-2); }
.stamp-default textarea {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 14px; font-family: inherit; resize: vertical;
}
.layout-choose { display: flex; flex-direction: column; gap: 6px; }
.layout-choose select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; min-width: 180px; }
.sub { font-size: 16px; color: var(--navy-2); margin: 22px 0 12px; }
.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.record-card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.record-card img { width: 100%; height: 160px; object-fit: cover; background: #eef2f7; }
.record-card textarea {
    border: none; border-top: 1px solid var(--line); padding: 8px 10px;
    font-size: 13px; font-family: inherit; resize: vertical; min-height: 48px;
}
.record-card textarea:focus { outline: 2px solid var(--navy-3); }
.record-actions { display: flex; gap: 12px; margin-top: 22px; }

/* ---- Stacked form (Bundle 5a) ---- */
.stack-form { max-width: 520px; display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy-2); }
.stack-form input {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; font-weight: 400;
}
.stack-form input:focus { outline: 2px solid var(--navy-3); border-color: var(--navy-3); }
.form-actions { display: flex; gap: 12px; margin-top: 6px; }

/* ---- CSV import (Bundle 5b) ---- */
.import-summary { display: flex; gap: 18px; flex-wrap: wrap; margin: 18px 0; font-size: 14px; }
.import-summary span { padding: 6px 12px; border-radius: 8px; background: var(--info-blue); color: var(--navy-3); }
.import-summary span.ok { background: #e7f4ec; color: var(--green); }
.import-summary span.warn { background: #fdf3e3; color: #9a6700; }
.import-summary span.err { background: #fbecee; color: var(--rose); }
.row-invalid { background: #fdf4f4 !important; }
.row-dup { background: #fdfaf0 !important; }
.row-err { font-size: 12px; color: var(--error); margin-top: 3px; }
.commit-form { margin-top: 22px; }
.dup-modes { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; }
.dup-modes legend { font-weight: 600; color: var(--navy-2); padding: 0 6px; }
.dup-modes label { display: block; margin: 7px 0; font-size: 14px; }
.import-messages ul { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ---- Installer notes (Bundle 7) ---- */
.notes-section { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 18px 0; }
.notes-section h2 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.notes-form textarea {
    width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px;
    padding: 10px 12px; font-size: 15px; font-family: inherit; resize: vertical; margin-top: 8px;
}
.notes-form textarea:focus { outline: 2px solid var(--navy-3); border-color: var(--navy-3); }
.notes-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.notes-readonly { margin-top: 8px; font-size: 15px; line-height: 1.6; }

/* ---- Task removal (Bundle 8) ---- */
.danger-zone { border: 1px solid #f0d4d4; background: #fdf6f6; border-radius: 12px; padding: 16px 20px; margin: 18px 0; }
.danger-zone h2 { margin: 0 0 4px; font-size: 15px; color: var(--rose); }
.btn-danger { background: var(--error); color: #fff; border: none; }
.btn-danger:hover { background: #9a1f17; }
.row-deleted { opacity: 0.6; }
.row-deleted td { text-decoration: none; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin-left: 4px; }
.confirm-card { max-width: 620px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 16px; }
.confirm-head { padding: 18px 22px; background: var(--info-blue); }
.confirm-head-danger { background: #fbecee; }
.confirm-head h1 { margin: 0 0 6px; font-size: 18px; color: var(--navy); }
.confirm-head p { margin: 0; font-size: 14px; }
.confirm-body { padding: 18px 22px; }

/* ---- Reopen / unlock (Bundle 10) ---- */
.reopen-form { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
