
:root{color-scheme:light;--bg:#fcf7d9;--panel:#fffaf0;--line:#e4c9c2;--muted:#795e4c;--accent:#604734}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:#604734;font:15px/1.6 system-ui,'Microsoft JhengHei',sans-serif}aside{position:fixed;inset:0 auto 0 0;width:240px;background:#604734;border-right:1px solid var(--line);padding:24px 16px;display:flex;flex-direction:column;overflow:auto}.brand{font-size:21px;font-weight:700;color:var(--accent);margin-bottom:30px}.brand span{display:block;font-size:11px;letter-spacing:2px;color:var(--muted)}nav button{display:block;width:100%;text-align:left;background:none;border:0;margin:5px 0;color:var(--muted)}nav button.active,nav button:hover{background:#f0c5d4;color:#604734}aside small{margin-top:auto;color:var(--muted)}main{margin-left:240px;padding:30px;max-width:1800px}header,.actions,.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}header{justify-content:space-between;margin-bottom:24px}h1,h2,p{margin:0 0 12px}h1{font-size:28px}h2{font-size:17px}header p,small,.muted{color:var(--muted)}button,select,input{font:inherit;color:inherit;background:#f6d8d6;border:1px solid var(--line);border-radius:8px;padding:9px 13px}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent)}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:16px}.charts{grid-template-columns:repeat(2,minmax(0,1fr))}.panel{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px;margin-bottom:16px;min-width:0}.grid .panel{margin:0}.number{font-size:32px;font-weight:700}.bar{display:grid;grid-template-columns:100px 1fr 45px;gap:10px;align-items:center;margin:10px 0}.track{background:#e4c9c2;border-radius:6px;overflow:hidden;height:10px}.fill{height:100%}.ring{width:130px;height:130px;border-radius:50%;display:grid;place-items:center;margin:15px auto}.ring span{background:var(--panel);border-radius:50%;width:106px;height:106px;display:grid;place-items:center;font-size:24px;font-weight:bold}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:12px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}th{color:var(--muted)}.toolbar{margin-bottom:14px}.toolbar input{flex:1;min-width:150px}#error{color:#a1263e}.graph{width:100%;height:480px;background:#fffaf0;border:1px solid var(--line);border-radius:8px;touch-action:none}.graph text{fill:#604734;font-size:11px;pointer-events:none}.graph circle{cursor:pointer}.graph line{stroke:#947665;stroke-width:1.2}.legend{display:flex;gap:15px;flex-wrap:wrap;margin:10px 0}.legend span{display:inline-flex;align-items:center;gap:6px}.dot{width:10px;height:10px;border-radius:50%}@media(max-width:1050px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){aside{position:static;width:auto}main{margin:0;padding:15px}.grid{grid-template-columns:1fr}nav{display:flex;flex-wrap:wrap}nav button{width:auto}}

/* Neapolitan theme */
aside .brand{color:#fcf7d9}aside .brand span,aside small,nav button{color:#f6d8d6}nav button.active,nav button:hover{color:#604734}aside button:focus-visible{outline-color:#fcf7d9}.grid:not(.charts) .panel:nth-child(odd){background:#f6d8d6}.grid:not(.charts) .panel:nth-child(even){background:#f0c5d4}.charts .panel{background:#fffaf0}th{background:#f6d8d6;color:#604734}tbody tr:hover{background:#fcf7d9}button:hover{background:#f0c5d4}input,select{background:#fffaf0}#lang{background:#f0c5d4}.panel{box-shadow:0 3px 12px #6047340d}.track{background:#ead8ce}.graph circle{stroke:#604734;stroke-width:0.7}.graph text{fill:#604734} .ring span{color:#604734}

/* Reports Management */

.report-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.report-toolbar h2 {
    margin: 0;
    color: #604734;
}

.report-toolbar p {
    color: #795e4c;
    margin: 8px 0;
}

.report-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.report-stat {
    background: #f6d8d6;
    border: 1px solid #e4c9c2;
    border-radius: 14px;
    padding: 22px;
    color: #604734;
}

.report-stat strong {
    display: block;
    font-size: 32px;
    margin-top: 8px;
}

.report-list {
    display: grid;
    gap: 12px;
}

.report-card {
    background: #fffaf0;
    border: 1px solid #e4c9c2;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.report-card h3 {
    margin: 0 0 8px;
    color: #604734;
    font-size: 16px;
}

.report-card p {
    margin: 0;
    font-size: 13px;
    color: #795e4c;
    overflow-wrap: anywhere;
}

.report-actions {
    display: flex;
    gap: 8px;
}

.report-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0c5d4;
    color: #604734;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.report-btn:hover {
    background: #e5b3c5;
}

.report-btn.primary {
    background: #604734;
    color: #fcf7d9;
}

.report-btn.primary:hover {
    background: #795e4c;
}

.report-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

#reportMessage {
    color: #604734;
    margin: 12px 0;
}

@media (max-width: 600px) {

    .report-stat-grid {
        grid-template-columns: 1fr;
    }

    .report-card {
        align-items: flex-start;
    }
}

/* =========================
   SAST Page
   ========================= */

.sast-panel {
    background: #fffaf0;
    border: 1px solid #e4c9c2;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    color: #604734;
}

.sast-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.sast-metric {
    background: #f6d8d6;
    border: 1px solid #e4c9c2;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #604734;
}

.sast-metric:nth-child(even) {
    background: #f0c5d4;
}

.sast-metric strong {
    font-size: 30px;
}

.sast-notice {
    background: #fcf7d9;
    border-left: 4px solid #604734;
    padding: 12px;
    border-radius: 6px;
}

.sast-bar-row {
    display: grid;
    grid-template-columns: 90px 1fr 40px;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
}

.sast-bar-track {
    background: #f6d8d6;
    height: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.sast-bar-fill {
    height: 100%;
    border-radius: 8px;
}

.sast-bar-fill.error {
    background: #dc2626;
}

.sast-bar-fill.warning {
    background: #d97706;
}

.sast-bar-fill.info {
    background: #2563eb;
}

.sast-bar-fill.unknown {
    background: #888888;
}

.sast-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.sast-toolbar input,
.sast-toolbar select {
    padding: 10px 14px;
    background: #fcf7d9;
    color: #604734;
    border: 1px solid #e4c9c2;
    border-radius: 8px;
}

.sast-toolbar input {
    flex: 1;
    min-width: 180px;
}

.sast-table-wrap {
    overflow-x: auto;
}

.sast-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sast-table th,
.sast-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e4c9c2;
    overflow-wrap: anywhere;
}

.sast-table th {
    background: #f6d8d6;
}

.sast-severity {
    font-weight: bold;
}

.sast-severity.error {
    color: #b91c1c;
}

.sast-severity.warning {
    color: #a16207;
}

.sast-severity.info {
    color: #1d4ed8;
}

.sast-remediation {
    padding: 16px;
    margin: 12px 0;
    background: #fcf7d9;
    border: 1px solid #e4c9c2;
    border-radius: 10px;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .sast-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .sast-metrics {
        grid-template-columns: 1fr;
    }
}

.scan-fields{display:flex;gap:14px;flex-wrap:wrap;align-items:end}.scan-fields label{display:grid;gap:5px;flex:1;min-width:180px}.scan-fields select{width:100%}.scan-picker p{margin:10px 0 0;overflow-wrap:anywhere}.scan-picker select:disabled{opacity:.6}

.history-card{border:1px solid var(--line);border-radius:12px;padding:18px;margin:12px 0;overflow-wrap:anywhere;background:var(--panel)}.history-head,.history-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.history-head{justify-content:space-between}.history-state{background:#f6d8d6;border-radius:8px;padding:4px 10px}.history-card small{display:block;margin-bottom:10px}.history-actions button{background:#f0c5d4}

.sast-bar-fill.medium,.sast-bar-fill.warning{background:#b7791f}.sast-bar-fill.high,.sast-bar-fill.critical{background:#b91c1c}.sast-bar-fill.low{background:#64748b}.sast-severity.medium{color:#926400}.sast-table details{max-width:360px;overflow-wrap:anywhere}



.auto-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.auto-form label{display:grid;gap:5px}.auto-form input{width:100%;min-width:0}.auto-form .wide{grid-column:1/-1}.auto-form button{justify-self:start;background:var(--accent);color:var(--bg)}.auto-form button:disabled{opacity:.55;cursor:not-allowed}.auto-job{overflow-wrap:anywhere;border-top:1px solid var(--line);padding:12px 0}.auto-progress{width:100%;accent-color:var(--accent)}.auto-warning{color:#a1263e}.auto-job a{color:var(--accent)}@media(max-width:700px){.auto-form{grid-template-columns:1fr}}
