/* Build Co Tools: sign-in, user bar, tools home and Access & Permissions.
   Uses the tokens defined in buildco-brand.css. */

.bc-auth-pending body { visibility: hidden; }

/* ---------- Sign-in page ---------- */
.bc-signin {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--dark-bg);
}
.bc-signin-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 40px 32px 28px;
    text-align: center;
}
.bc-signin-card img { height: 46px; width: auto; margin-bottom: 26px; }
.bc-signin-card h1 { font-size: 24px; margin: 0 0 8px; color: var(--text-white); }
.bc-signin-card p { color: var(--text-muted); font-size: 14px; line-height: 1.55; margin: 0 0 26px; }
.bc-ms-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid #8C8C8C;
    background: #FFFFFF;
    color: #5E5E5E;
    font-family: 'Segoe UI', var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.bc-ms-btn:hover { background: #F3F3F3; border-color: #5E5E5E; }
.bc-ms-btn:disabled { opacity: 0.6; cursor: progress; }
.bc-ms-btn i { font-size: 18px; color: #5E5E5E; }
.bc-signin-error {
    display: none;
    text-align: left;
    background: rgba(217, 48, 37, 0.12);
    border: 1px solid var(--error-color);
    color: var(--text-white);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 18px;
}
.bc-signin-foot {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Blocked / no access ---------- */
.bc-gate {
    max-width: 480px;
    margin: 12vh auto;
    padding: 0 16px;
    text-align: center;
}
.bc-gate-logo { height: 42px; margin-bottom: 24px; }
.bc-gate h1 { font-size: 24px; color: var(--text-white); }
.bc-gate p { color: var(--text-muted); line-height: 1.55; }
.bc-gate-email { font-family: var(--font-mono); font-size: 13px; }
.bc-gate-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------- User bar (injected into each page header) ---------- */
.bc-userbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    padding-left: 20px;
}
.bc-userbar-home { color: var(--text-muted); font-size: 18px; }
.bc-userbar-home:hover { color: var(--primary-color); }
.bc-userbar-who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.bc-userbar-name { color: var(--text-white); font-weight: 600; font-size: 14px; }
.bc-userbar-role {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
@media (max-width: 720px) {
    header { flex-wrap: wrap; gap: 12px; }
    .bc-userbar { width: 100%; margin-left: 0; padding-left: 0; justify-content: space-between; }
    .bc-userbar-who { text-align: left; }
}

/* ---------- Tools home ---------- */
.bc-home-header .bc-brand { display: flex; align-items: center; gap: 18px; }
.bc-home-header .bc-brand img { height: 40px; width: auto; }
.bc-home-header h1 {
    font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -0.01em;
    background: none; -webkit-text-fill-color: currentColor; color: var(--text-white);
}
.bc-eyebrow {
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    margin: 0 0 6px;
}
.bc-intro { max-width: 760px; color: var(--text-muted); line-height: 1.6; margin: 0 0 28px; }
.bc-section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 34px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.bc-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.bc-tool {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px 22px 20px;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
a.bc-tool:hover { border-color: var(--primary-color); transform: translateY(-2px); color: inherit; box-shadow: var(--shadow-md); }
.bc-tool-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(255, 107, 0, 0.12);
    color: var(--accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.bc-tool h3 { margin: 4px 0 0; font-size: 17px; color: var(--text-white); }
.bc-tool p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; flex: 1; }
.bc-tool-cta { color: var(--accent-text); font-weight: 700; font-size: 14px; }
/* Status tags follow the Brand Guide status tag set */
.bc-tool-tag {
    position: absolute;
    top: 18px; right: 18px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}
.bc-tool-tag.live { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.bc-tool-tag.dev { background: rgba(255, 183, 0, 0.14); color: var(--warning-color); }
.light-theme .bc-tool-tag { background: #ECECEC; color: #5A5A5A; }
.light-theme .bc-tool-tag.live { background: #E4E4E4; color: #1E1E1E; }
.light-theme .bc-tool-tag.dev { background: #FFF1CC; color: #8A6500; }
.bc-tool.is-disabled { opacity: 0.6; }
.bc-tool .bc-tool-sub { font-size: 12px; color: var(--text-muted); }
.bc-tool .bc-tool-sub a { color: var(--text-muted); text-decoration: underline; }
.bc-admin-only { display: none !important; }
.role-admin-or-owner .bc-admin-only { display: block !important; }
.bc-home-footer { margin-top: 48px; }

/* ---------- Access & Permissions ---------- */
.bc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bc-toolbar h2 { margin: 0; }
.bc-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--card-bg); box-shadow: var(--shadow-sm); }
.bc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bc-table th {
    text-align: left;
    background: var(--th-bg);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 11px 14px;
    white-space: nowrap;
    border: none;
}
.bc-table td { padding: 11px 14px; border-top: 1px solid var(--row-line); border-bottom: none; vertical-align: middle; color: var(--text-white); }
.bc-table td.muted { color: var(--text-muted); }
.bc-table select { margin: 0; min-width: 160px; }
.bc-table .bc-empty { text-align: center; color: var(--text-muted); padding: 22px; }
.bc-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    margin-left: 6px;
    vertical-align: middle;
}
.bc-badge.owner { background: rgba(255, 107, 0, 0.16); color: var(--primary-color); }
.light-theme .bc-badge { background: #ECECEC; color: #5A5A5A; }
.light-theme .bc-badge.owner { background: #FFE6D2; color: #B24A00; }
.bc-note { color: var(--text-muted); font-size: 13px; line-height: 1.55; margin: 10px 0 0; }
.bc-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 26px; }
.bc-role-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.bc-role-card h4 { margin: 0 0 6px; color: var(--text-white); font-size: 14px; }
.bc-role-card p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.bc-modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center; justify-content: center;
    padding: 16px;
    z-index: 1000;
}
.bc-modal.open { display: flex; }
.bc-modal-box {
    width: 100%; max-width: 480px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    border-top: 4px solid var(--primary-color);
    padding: 22px;
    box-shadow: var(--shadow-lg);
}
.bc-modal-box h3 { margin: 0 0 14px; color: var(--text-white); }
.bc-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.bc-toast {
    position: fixed; bottom: 22px; left: 50%;
    transform: translateX(-50%);
    background: var(--footer-bg);
    color: var(--text-white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--success-color);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 1100;
    display: none;
}
.bc-toast.err { border-left-color: var(--error-color); }
.bc-toolbar h2 { font-size: 20px; }

/* ---------- Theme switch and light-mode adjustments ---------- */
.bc-icon-btn {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--field-border);
    background: transparent;
    color: var(--text-white);
    cursor: pointer;
    font-size: 15px;
}
.bc-icon-btn:hover { color: var(--accent-text); border-color: var(--primary-color); }
.light-theme .bc-signin-card { box-shadow: var(--shadow-md); }
.light-theme .bc-modal { background: rgba(10, 10, 10, 0.45); }
.bc-table tbody tr:nth-child(even) { background: var(--zebra); }
