:root,
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1220;
    --surface: #111827;
    --surface-soft: #172033;
    --panel2: var(--surface-soft);
    --surface-muted: #1b2537;
    --surface-hover: #182235;
    --text: #f2f4f7;
    --text-strong: #ffffff;
    --muted: #98a2b3;
    --line: #273244;
    --line-soft: #202b3c;
    --nav: #070d18;
    --nav-soft: #182235;
    --nav-text: #d0d5dd;
    --nav-label: #667085;
    --input-bg: #0d1524;
    --input-border: #344054;
    --accent: #ef4444;
    --blue: #84adff;
    --green: #75e0a7;
    --red: #fda29b;
    --yellow: #fec84b;
    --purple: #bdb4fe;
    --link: #84adff;
    --btn-light-bg: #172033;
    --btn-light-text: #e4e7ec;
    --shadow: rgba(0, 0, 0, .24);
    --row-hover: #151f31;
    --badge-bg: #202b3c;
    --badge-text: #d0d5dd;
    --status-blue-bg: #122449;
    --status-green-bg: #123525;
    --status-red-bg: #421b1f;
    --status-yellow-bg: #3b2b12;
    --status-purple-bg: #2c2458;
    --alert-success-bg: #102f22;
    --alert-success-border: #1f6f50;
    --alert-error-bg: #3a171b;
    --alert-error-border: #8f3534;
    --alert-info-bg: #112b46;
    --alert-info-border: #285e8e;
    --confidential-bg: #332710;
    --confidential-border: #b47716;
    --confidential-text: #ffd37a;
    --danger-bg: #291416;
    --commercial-bg: #292411;
    --commercial-border: #8a6c1d;
    --timeline: #344054;
    --border: var(--line);
    --panel: var(--surface);
    --focus: #528bff;
    --warning: #fec84b;
    --warning-bg: #3b2b12;
    --danger: #fda29b;
    --danger-bg: #291416;
    --on-accent: #ffffff;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-soft: #fafafa;
    --panel2: var(--surface-soft);
    --surface-muted: #f2f4f7;
    --surface-hover: #fafafa;
    --text: #182230;
    --text-strong: #101828;
    --muted: #667085;
    --line: #e4e7ec;
    --line-soft: #f0f1f3;
    --nav: #101828;
    --nav-soft: #1d2939;
    --nav-text: #d0d5dd;
    --nav-label: #667085;
    --input-bg: #ffffff;
    --input-border: #d0d5dd;
    --accent: #e53935;
    --blue: #175cd3;
    --green: #067647;
    --red: #b42318;
    --yellow: #b54708;
    --purple: #6938ef;
    --link: #175cd3;
    --btn-light-bg: #ffffff;
    --btn-light-text: #344054;
    --shadow: rgba(16, 24, 40, .05);
    --row-hover: #fafafa;
    --badge-bg: #f2f4f7;
    --badge-text: #475467;
    --status-blue-bg: #eff4ff;
    --status-green-bg: #ecfdf3;
    --status-red-bg: #fef3f2;
    --status-yellow-bg: #fffaeb;
    --status-purple-bg: #f4f3ff;
    --alert-success-bg: #ecfdf3;
    --alert-success-border: #abefc6;
    --alert-error-bg: #fef3f2;
    --alert-error-border: #fecdca;
    --alert-info-bg: #eff8ff;
    --alert-info-border: #b2ddff;
    --confidential-bg: #fffaeb;
    --confidential-border: #f79009;
    --confidential-text: #93370d;
    --danger-bg: #fffafa;
    --commercial-bg: #fffdf5;
    --commercial-border: #fedf89;
    --timeline: #cfd4dc;
    --border: var(--line);
    --panel: var(--surface);
    --focus: #175cd3;
    --warning: #b54708;
    --warning-bg: #fffaeb;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --on-accent: #ffffff;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    transition: background-color .18s ease, color .18s ease;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
input, select, textarea { color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
hr { border-color: var(--line) !important; }
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 238px;
    background: var(--nav);
    color: white;
    padding: 22px 16px;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.04);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 8px 24px; }
.brand-icon { font-size: 26px; }
.brand strong { display: block; font-size: 20px; color: #fff; }
.brand small { display: block; font-size: 11px; color: #98a2b3; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { margin: 18px 10px 6px; color: var(--nav-label); font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.ff-nav-icon{display:inline-flex;width:20px;justify-content:center;margin-right:7px;font-size:15px;opacity:.9}.ff-menu-icon{display:inline-block;margin-right:5px;color:var(--blue)}
.nav-link { color: var(--nav-text); text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.nav-link:hover { background: var(--nav-soft); color: white; }
.nav-link-primary { background: #344054; color: white; }
.main-shell { margin-left: 238px; min-height: 100vh; }
.main-shell.full { margin-left: 0; }
.topbar {
    height: 66px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(10px);
}
.role-badge { background: var(--badge-bg); color: var(--badge-text); border-radius: 999px; padding: 4px 9px; margin-left: 7px; font-size: 12px; }
.content { padding: 28px; max-width: 1500px; margin: 0 auto; }
.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; }
.page-head h1 { margin:0 0 5px; font-size: 26px; color: var(--text-strong); }
.page-head p { margin:0; color:var(--muted); }
.grid { display:grid; gap:16px; }
.stats { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 3fr) minmax(0, 2fr); margin-bottom:20px; }
.card {
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:12px;
    padding:20px;
    box-shadow:0 1px 3px var(--shadow);
    transition: background-color .18s ease, border-color .18s ease;
}
.stat .label { color:var(--muted); font-size:13px; }
.stat .value { margin-top:8px; font-size:28px; font-weight:750; color: var(--text-strong); }
.stat .hint { margin-top:4px; color:var(--muted); font-size:12px; }
.section-title { display:flex; justify-content:space-between; align-items:center; margin:0 0 10px; }
.section-title h2 { margin:0; font-size:17px; color: var(--text-strong); }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th { text-align:left; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid var(--line); padding:11px 10px; white-space:nowrap; }
td { border-bottom:1px solid var(--line-soft); padding:12px 10px; font-size:13px; vertical-align:middle; }
tbody tr:hover { background:var(--row-hover); }
.project-link { color:var(--link); font-weight:700; text-decoration:none; }
.project-link:hover { text-decoration: underline; }
.muted { color:var(--muted); }
.small { font-size:12px; }
.status { display:inline-block; border-radius:999px; padding:5px 9px; font-size:11px; font-weight:700; background:var(--status-blue-bg); color:var(--blue); white-space:nowrap; }
.status-blue { background:var(--status-blue-bg); color:var(--blue); }
.status-green { background:var(--status-green-bg); color:var(--green); }
.status-red { background:var(--status-red-bg); color:var(--red); }
.status-yellow { background:var(--status-yellow-bg); color:var(--yellow); }
.status-purple { background:var(--status-purple-bg); color:var(--purple); }
.btn { border:1px solid transparent; border-radius:8px; padding:9px 13px; font-weight:700; text-decoration:none; display:inline-flex; justify-content:center; align-items:center; gap:7px; cursor:pointer; transition:filter .15s ease, background-color .15s ease, border-color .15s ease; }
.btn:hover { filter: brightness(1.06); }
.btn-primary { background:#182235; color:white; border-color:#344054; }
html[data-theme="light"] .btn-primary { background:var(--nav); color:white; border-color:transparent; }
.btn-accent { background:var(--accent); color:white; }
.btn-light { background:var(--btn-light-bg); border-color:var(--line); color:var(--btn-light-text); }
.btn-small { padding:6px 10px; font-size:12px; }
.btn-green { background:#067647; color:white; }
.btn-red { background:#b42318; color:white; }
.btn-purple { background:#6938ef; color:white; }
.form-card { max-width:920px; }
.daily-report-form-shell { width:100%; max-width:none; }
.daily-report-required-note { margin:0 0 18px; }
.daily-report-activity-card > .section-title { margin-bottom:14px; }
.daily-report-activity-add { margin-top:16px; }
.daily-activity-delete-control { display:flex; align-items:center; gap:8px; margin-left:auto; }
.daily-activity-delete-control > input[type="checkbox"] { display:none; }
.daily-activity-delete-control > .daily-activity-delete { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:6px 11px; border:1px solid var(--line); border-radius:7px; background:var(--status-red-bg); color:var(--red); font:inherit; font-size:12px; font-weight:700; cursor:pointer; }
.daily-activity-delete-control > .daily-activity-delete:hover { filter:brightness(1.12); }
.daily-activity-summary { gap:12px; }
.daily-activity-summary-title { flex:1; }
.daily-report-activity-card > .section-title, .daily-report-form-actions { gap:12px; }
@media(max-width:1000px){.daily-report-required-note{margin-bottom:16px}.daily-report-activity-add{margin-top:14px}}
.daily-report-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; align-items:start; width:100%; }
.daily-report-columns > .form-card { max-width:none; min-width:0; margin-bottom:0 !important; }
.daily-report-main-card .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.daily-report-main-card .form-group.full { grid-column:1 / -1; }
.daily-report-activity-card { display:flex; flex-direction:column; }
#dr-activity-list { display:flex; flex-direction:column; gap:10px; }
.daily-activity-card { width:100%; margin:0; padding:0; border:1px solid var(--line); border-radius:10px; background:var(--surface, rgba(255,255,255,.02)); }
.daily-activity-summary { display:flex; align-items:center; gap:10px; padding:12px; cursor:pointer; list-style:none; }
.daily-activity-summary::-webkit-details-marker { display:none; }
.daily-activity-summary::after { content:"+"; margin-left:4px; color:var(--muted); font-size:20px; }
.daily-activity-card[open] > .daily-activity-summary::after { content:"−"; }
.daily-activity-summary-title { min-width:0; overflow:hidden; color:var(--text); text-overflow:ellipsis; white-space:nowrap; }
.daily-activity-delete-control { margin-left:auto; }
.daily-activity-delete-control .daily-activity-delete { display:inline-flex; align-items:center; gap:5px; margin:0; color:var(--red); cursor:pointer; font-size:12px; font-weight:700; white-space:nowrap; }
.daily-activity-content { padding:4px 12px 12px; border-top:1px solid var(--line); }
.daily-activity-content .form-grid { grid-template-columns:1fr; gap:0; }
.daily-activity-content .form-group.full { grid-column:auto; }
.daily-report-form-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
@media(max-width:1000px){.daily-report-columns{grid-template-columns:1fr}.daily-report-main-card .form-grid{grid-template-columns:1fr}}
@media(max-width:600px){.daily-activity-summary{flex-wrap:wrap}.daily-activity-summary-title{order:3;flex-basis:100%}.daily-report-form-actions{justify-content:flex-start}}
.form-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:16px; }
.form-group { margin-bottom:16px; }
.form-group.full { grid-column:1 / -1; }
.form-group label { display:block; margin-bottom:6px; font-size:13px; font-weight:700; }
.form-control, .form-group input, .form-group select, .form-group textarea {
    width:100%;
    padding:10px 11px;
    border:1px solid var(--input-border);
    border-radius:8px;
    background:var(--input-bg);
    color:var(--text);
    outline: none;
}
.form-control:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #528bff;
    box-shadow: 0 0 0 3px rgba(82,139,255,.14);
}
textarea.form-control { resize:vertical; }
.checkbox-list ul, ul.checkbox-list { list-style:none; padding:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.help { color:var(--muted); font-size:12px; margin-top:4px; }
.errorlist { color:var(--red); margin:5px 0; padding-left:18px; font-size:12px; }
.filter-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.filter-bar .form-control { width:auto; min-width:170px; }
.detail-grid { display:grid; grid-template-columns:2fr 1fr; gap:18px; }
.info-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.info-item .k { color:var(--muted); font-size:11px; text-transform:uppercase; font-weight:700; }
.info-item .v { margin-top:5px; font-weight:650; }
.timeline { list-style:none; margin:0; padding:0; }
.timeline li { position:relative; padding:0 0 20px 24px; border-left:2px solid var(--timeline); margin-left:7px; }
.timeline li:before { content:""; position:absolute; left:-6px; top:3px; width:10px; height:10px; border-radius:50%; background:#528bff; }
.timeline li:last-child { border-left-color:transparent; }
.comment { padding:14px 0; border-bottom:1px solid var(--line-soft); }
.project-discussion-history-v1 {
  margin-top:16px;
  padding-right:8px;
}
.project-discussion-history-v1 .comment:first-child { padding-top:0; }
.ff-process-activity-scroll,
.ffv3-workflow-activity-scroll {
  padding-right:8px;
}
.ffv3-workflow-activity-scroll .ffv3-event:last-child { border-bottom:0; }
.comment-head { display:flex; justify-content:space-between; gap:10px; font-size:12px; color:var(--muted); margin-bottom:6px; }
.inline-form { display:grid; grid-template-columns:1fr 160px; gap:8px; }
.assignment-box { border:1px dashed var(--input-border); border-radius:10px; padding:14px; margin-top:12px; }
.alert { padding:12px 14px; border-radius:8px; margin-bottom:16px; border:1px solid var(--line); background:var(--surface); }
.alert-success { background:var(--alert-success-bg); color:var(--green); border-color:var(--alert-success-border); }
.alert-error { background:var(--alert-error-bg); color:var(--red); border-color:var(--alert-error-border); }
.alert-info { background:var(--alert-info-bg); color:var(--blue); border-color:var(--alert-info-border); }
.confidential { border:1px dashed var(--confidential-border); background:var(--confidential-bg); border-radius:9px; padding:12px; font-size:12px; color:var(--confidential-text); }
.empty { text-align:center; color:var(--muted); padding:30px 10px; }
.pipeline-bars{display:grid;gap:12px}
.pipeline-row{display:grid;grid-template-columns:110px 1fr 34px;align-items:center;gap:12px;font-size:13px}
.pipeline-label{color:var(--muted)}
.pipeline-track{height:10px;background:var(--surface-muted);border-radius:999px;overflow:hidden}
.pipeline-fill{height:100%;background:#528bff;border-radius:999px}
.action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.danger-zone{border-color:var(--alert-error-border);background:var(--danger-bg)}
.file-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:11px 0;border-bottom:1px solid var(--line-soft)}
.file-row:last-child{border-bottom:0}
.badge-soft{font-size:10px;padding:4px 7px;border-radius:999px;background:var(--badge-bg);color:var(--badge-text)}
.subtle-box{padding:13px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}
.top-actions{display:flex;align-items:center;gap:10px}
.notification-button{position:relative;text-decoration:none;font-size:19px;padding:6px;border-radius:8px}
.notification-button:hover{background:var(--surface-muted)}
.notification-button span,.nav-count{display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;border-radius:999px;background:#e53935;color:#fff;font-size:10px;font-weight:800}
.notification-button span{position:absolute;right:-2px;top:-3px}
.nav-count{float:right;margin-left:6px}
.notification-row{display:flex;justify-content:space-between;gap:16px;padding:15px 12px;border-bottom:1px solid var(--line-soft);text-decoration:none}
.notification-row:hover{background:var(--row-hover)}
.notification-row.unread{background:var(--alert-info-bg);border-left:3px solid #528bff}
.management-grid{grid-template-columns:1fr 1fr}
.workload-row,.activity-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line-soft)}
.workload-row:last-child,.activity-row:last-child{border-bottom:0}
.aging-badge{font-size:11px;font-weight:800;padding:4px 8px;border-radius:999px;background:var(--badge-bg);color:var(--badge-text)}
.aging-yellow{background:var(--status-yellow-bg);color:var(--yellow)}
.aging-red{background:var(--status-red-bg);color:var(--red)}
.commercial-action-card{margin-bottom:20px;border-color:var(--commercial-border);background:var(--commercial-bg)}
.commercial-steps{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.commercial-step{padding:7px 10px;border-radius:8px;background:var(--badge-bg);font-size:11px;font-weight:700;color:var(--badge-text)}
.commercial-step.done{background:var(--status-green-bg);color:var(--green)}
.commercial-step.current{background:var(--status-blue-bg);color:var(--blue)}
.audit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.audit-item{border:1px solid var(--line);border-radius:8px;padding:10px;background:var(--surface-soft)}
.audit-item .k{font-size:10px;color:var(--muted);font-weight:800;text-transform:uppercase}
.audit-item .v{font-size:12px;font-weight:700;margin-top:4px}

/* Theme switcher */
.theme-toggle {
    min-height: 34px;
    border: 1px solid var(--line);
    background: var(--btn-light-bg);
    color: var(--btn-light-text);
    border-radius: 999px;
    padding: 5px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.theme-toggle:hover { background: var(--surface-muted); }
.theme-icon { width: 18px; height: 18px; align-items: center; justify-content: center; font-size: 17px; line-height: 1; }
.theme-icon-sun { display: inline-flex; }
.theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: inline-flex; }
.theme-toggle-text { color: var(--muted); }

/* Login */
.login-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:var(--bg); }
.login-card { width:min(420px,92vw); background:var(--surface); color:var(--text); padding:34px; border:1px solid var(--line); border-radius:16px; box-shadow:0 18px 50px var(--shadow); }
.login-card h1 { margin:0 0 6px; color:var(--text-strong); }
.login-card p { color:var(--muted); margin:0 0 24px; }
.login-card label { display:block; font-weight:700; font-size:13px; margin:14px 0 6px; }
.login-card input { width:100%; padding:11px; border:1px solid var(--input-border); border-radius:8px; background:var(--input-bg); color:var(--text); }
.login-theme { position:fixed; top:18px; right:18px; }

@media (max-width: 1000px) {
    .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .detail-grid { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
    .sidebar { position:static; width:100%; }
    .main-shell { margin-left:0; }
    .nav { display:flex; flex-direction:column; gap:5px; }
    .nav-label { grid-column:auto; }
    .content { padding:18px; }
    .topbar { padding:0 14px; }
    .stats, .form-grid, .info-grid { grid-template-columns:1fr; }
    .page-head { flex-direction:column; }
    .action-grid{grid-template-columns:1fr}
    .pipeline-row{grid-template-columns:90px 1fr 28px}
    .management-grid,.audit-grid{grid-template-columns:1fr}
    .notification-row{flex-direction:column}
    .theme-toggle-text { display:none; }
}


/* ===== FireFlow branding update ===== */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 6px 8px 24px;
}
.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: block;
}
.brand-text {
    min-width: 0;
}
.brand strong {
    display: block;
    font-size: 20px;
    line-height: 1.1;
    color: #fff;
    letter-spacing: -.01em;
}
.brand small {
    display: block;
    font-size: 11px;
    color: #98a2b3;
    margin-top: 4px;
    line-height: 1.35;
}
.topbar {
    align-items: center;
}
.topbar-user strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}
.topbar-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.login-card-branding {
    max-width: 520px;
}
.login-branding {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 14px;
    text-align: center;
}

.login-brand-logo {
    display: block;
    width: min(100%, 260px);
    height: auto;
    margin: 0 auto;
}
.login-subtitle {
    margin: 6px 0 18px;
    text-align: center;
    color: var(--muted);
}
@media (max-width: 760px) {
    .login-branding {
        flex-direction: column;
        gap: 10px;
    }
    .login-brand-logo {
        width: min(100%, 280px);
    }
}
.login-card {
    text-align: left;
}

.login-card .login-branding,
.login-card .login-subtitle {
    text-align: center;
}
.mobile-menu-toggle .menu-symbol {
    display: block;
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;
    margin: 0;
    transform: none !important;
    opacity: 1 !important;
}
.mobile-menu-toggle .menu-svg {
    display: block;
    width: 22px;
    height: 22px;
}

/* FIREFLOW_PBDMS_BRANDING_V1 START */
.pbdms-theme-logo { display:block; }
.pbdms-theme-logo-light { display:none; }
html[data-theme="light"] .pbdms-theme-logo-dark { display:none; }
html[data-theme="light"] .pbdms-theme-logo-light { display:block; }

.pbdms-login-branding { margin-bottom:8px; }
.login-brand-logo.pbdms-theme-logo {
    width:min(100%,360px);
    max-height:92px;
    object-fit:contain;
    object-position:center;
}
.pbdms-login-name {
    margin:2px 0 8px;
    text-align:center;
    color:var(--text-strong);
    font-size:22px;
    line-height:1.1;
    font-weight:850;
    letter-spacing:.06em;
}
.login-card .login-subtitle {
    max-width:390px;
    margin:0 auto 24px;
    color:var(--muted);
    font-size:15px;
    line-height:1.4;
    text-align:center;
}

.brand {
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:5px;
    padding:4px 8px 20px;
}
.pbdms-sidebar-logo {
    display:block;
    width:100%;
    max-width:190px;
    height:auto;
    max-height:66px;
    object-fit:contain;
    object-position:left center;
}
.pbdms-sidebar-name {
    display:inline-flex;
    align-items:center;
    min-height:22px;
    color:#f2f4f7;
    font-size:13px;
    line-height:1;
    font-weight:850;
    letter-spacing:.12em;
}
.brand .pbdms-sidebar-logo { flex:0 1 auto; }

@media (max-width:760px) {
    .login-brand-logo.pbdms-theme-logo {
        width:min(100%,330px);
        max-height:82px;
    }
    .pbdms-login-name { font-size:20px; }
    .pbdms-sidebar-logo { max-width:178px; }
}
/* FIREFLOW_PBDMS_BRANDING_V1 END */

/* FIREFLOW_STABLE_SVG_ICON_SYSTEM_V5 START */
.ff-ui-icon{
    width:18px;
    height:18px;
    display:inline-block;
    flex:0 0 auto;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
    vertical-align:-0.16em;
    pointer-events:none;
}
.ff-ui-icon-inline{
    width:1em;
    height:1em;
    margin-right:4px;
}
.ff-lock-icon{
    width:1em;
    height:1em;
    min-width:1em;
    min-height:1em;
    display:inline-block;
    vertical-align:-0.16em;
    overflow:visible;
}
.notification-button .ff-ui-icon-bell{
    width:19px;
    height:19px;
}
.theme-icon .ff-ui-icon{
    width:18px;
    height:18px;
}
.ff-live-toast-kicker-row-v5{
    display:flex;
    align-items:center;
    gap:7px;
    margin:0 30px 5px 0;
}
.ff-live-toast-kicker-row-v5 .ff-live-toast-kicker{
    margin:0;
}
.ff-live-toast-bell-v5{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#78a7ff;
}
.ff-live-toast-bell-v5 .ff-ui-icon{
    width:16px;
    height:16px;
}
.ff-live-toast-close .ff-ui-icon-close{
    width:14px;
    height:14px;
}
.ff-workload-chevron-v4 .ff-ui-icon{
    width:13px;
    height:13px;
}
.ff-logout-icon{
    display:inline-block;
}
.ff-logout-icon-only{
    width:38px;
    min-width:38px;
    height:38px;
    min-height:38px;
    border-radius:50% !important;
    padding:0 !important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:0;
}
.ff-logout-icon-only .ff-logout-icon,
.ff-logout-icon-only > i{
    width:18px;
    height:18px;
    font-size:18px;
    line-height:1;
    color: var(--btn-light-text) !important;
}
/* FIREFLOW_THEME_CONTRAST_V1 START */
:root {
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent);
}

html[data-theme="light"] {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #eef2f6;
    --surface-hover: #f1f5f9;
    --text: #1d2939;
    --text-strong: #101828;
    --muted: #475467;
    --line: #cfd4dc;
    --line-soft: #e4e7ec;
    --input-bg: #ffffff;
    --input-border: #98a2b3;
    --row-hover: #f1f5f9;
    --badge-bg: #eef2f6;
    --badge-text: #344054;
    --shadow: rgba(16, 24, 40, .08);
}

body,
button,
input,
select,
textarea {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
    outline-offset: 2px;
}

.topbar,
.card,
.subtle-box,
.assignment-box,
.audit-item,
.checkbox-inline-card,
.scope-checklist label,
.login-card,
.form-control,
.form-group input,
.form-group select,
.form-group textarea,
.btn,
.theme-toggle,
.mobile-menu-toggle {
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.topbar { color: var(--text); }
.topbar-user strong,
.section-title h2,
.page-head h1,
.info-item .v,
.customer-info-item .v,
.customer-address .v,
.stat .value,
.login-card h1,
.pbdms-login-name { color: var(--text-strong); }

.card,
.login-card,
.subtle-box,
.audit-item,
.assignment-box,
.checkbox-inline-card {
    color: var(--text);
}

.table-wrap { border-radius: 10px; }
table { color: var(--text); }
thead th {
    background: var(--surface-soft);
    color: var(--text-strong);
    border-bottom-color: var(--line);
}
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-soft) 58%, transparent); }
tbody tr:hover { background: var(--row-hover); }
td { color: var(--text); }

.form-control,
.form-group input,
.form-group select,
.form-group textarea,
.login-card input {
    background: var(--input-bg);
    color: var(--text);
    border-color: var(--input-border);
}
.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.login-card input:focus {
    border-color: var(--focus);
    box-shadow: var(--focus-ring);
}
select option { background: var(--surface); color: var(--text); }

.btn { color: var(--text); }
.btn-primary,
.btn-green,
.btn-red,
.btn-purple,
.btn-accent { color: var(--on-accent); }
.btn-light { background: var(--btn-light-bg); color: var(--btn-light-text); border-color: var(--line); }
.btn-light:hover,
.theme-toggle:hover,
.mobile-menu-toggle:hover { border-color: var(--focus); }
.btn:disabled,
button:disabled,
input:disabled,
select:disabled,
textarea:disabled { opacity: .58; cursor: not-allowed; }

.nav-link,
.nav-label,
.brand,
.sidebar { color: var(--nav-text); }
.nav-link-primary { color: #fff; }
.notification-button { color: var(--text); }

html[data-theme="light"] .brand strong,
html[data-theme="light"] .brand small,
html[data-theme="light"] .pbdms-sidebar-name { color: #f8fafc; }
html[data-theme="light"] .project-table-unified .team-line span,
html[data-theme="light"] .project-table-unified .project-date-label,
html[data-theme="light"] .project-table-unified .project-inquiry-date,
html[data-theme="light"] .project-table-unified .deadline-source,
html[data-theme="light"] .project-table-unified .stage-progress-meta {
    color: var(--muted);
    opacity: 1;
}
html[data-theme="light"] .project-table-unified .stage-progress-note { color: var(--text-strong); }

html[data-theme="light"] .deadline-state.warning,
html[data-theme="light"] .project-table-unified .deadline-state.warning {
    background: #fffaeb;
    color: #93370d;
    border: 1px solid #fedf89;
}
html[data-theme="light"] .deadline-state.danger,
html[data-theme="light"] .project-table-unified .deadline-state.danger {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}
html[data-theme="light"] table tbody tr.project-deadline-warning > td { background: #fffaeb !important; }
html[data-theme="light"] table tbody tr.project-deadline-danger > td { background: #fef3f2 !important; }

@media (prefers-contrast: more) {
    :root {
        --line: #667085;
        --line-soft: #98a2b3;
    }
    .muted,
    .help,
    .stat .label,
    .stat .hint { color: var(--text); }
}
/* FIREFLOW_SIDEBAR_THEME_V1 START */
.sidebar {
    background: var(--nav);
    color: var(--nav-text);
    border-right-color: color-mix(in srgb, var(--line) 76%, transparent);
    box-shadow: 8px 0 28px color-mix(in srgb, var(--shadow) 72%, transparent);
}

.brand {
    border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.pbdms-sidebar-logo {
    width: 100%;
    max-width: 190px;
    min-height: 44px;
    max-height: 66px;
    object-fit: contain;
    object-position: left center;
}

.sidebar .pbdms-theme-logo-light { display: none; }
.sidebar .pbdms-theme-logo-dark { display: block; }

.nav-link {
    color: var(--nav-text);
}
.nav-link:hover,
.nav-link:focus-visible {
    background: var(--nav-soft);
    color: var(--nav-text);
}
.nav-link-primary {
    background: var(--accent);
    color: var(--on-accent);
    border: 1px solid color-mix(in srgb, var(--accent) 72%, var(--line));
}
.nav-link-primary:hover,
.nav-link-primary:focus-visible {
    background: color-mix(in srgb, var(--accent) 88%, var(--surface));
    color: var(--on-accent);
}

html[data-theme="light"] .sidebar {
    --nav: #ffffff;
    --nav-soft: #eef2f6;
    --nav-text: #344054;
    --nav-label: #667085;
    border-right-color: #d0d5dd;
    box-shadow: 8px 0 26px rgba(16, 24, 40, .08);
}
html[data-theme="light"] .sidebar .pbdms-theme-logo-dark { display: none; }
html[data-theme="light"] .sidebar .pbdms-theme-logo-light { display: block; }
html[data-theme="light"] .sidebar .pbdms-sidebar-name { color: #101828; }
html[data-theme="light"] .sidebar .nav-link-primary {
    background: #e53935;
    color: #ffffff;
    border-color: #c92f2c;
}
html[data-theme="light"] .sidebar .nav-link-primary:hover,
html[data-theme="light"] .sidebar .nav-link-primary:focus-visible {
    background: #c92f2c;
    color: #ffffff;
}

@media (max-width: 1199px) {
    .sidebar {
        box-shadow: 14px 0 40px color-mix(in srgb, var(--shadow) 92%, transparent);
    }
}
/* FIREFLOW_SIDEBAR_THEME_V1 END */
.daily-report-detail-actions .daily-report-detail-action {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 480px) {
  .daily-report-detail-actions { flex-wrap: wrap; }
  .daily-report-detail-actions .daily-report-detail-action { flex: 1 1 104px; }
}
