:root {
    --cf-orange: #F6821F;
    --cf-dark: #051126;
    --bg-gray: #F7F8FA;
    --border: #E5E7EB;
    --border-light: #F0F1F3;
    --text-main: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --p1-red: #FEE2E2;
    --p1-text: #991B1B;
    --p2-yellow: #FEF3C7;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.04);
    --danger-red: #DC2626;
    --danger-red-hover: #B91C1C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-gray);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: white;
    min-height: 100vh;
    border-right: 1px solid var(--border-light);
    padding: 32px 24px;
    position: fixed;
    left: 0;
    top: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-container img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.side-section {
    margin-bottom: 32px;
}

.side-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.help-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.sidebar label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 6px;
    margin-top: 12px;
}

textarea, select, input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

textarea:focus, select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--cf-orange);
}

.dashboard {
    margin-left: 280px;
    padding: 40px 48px;
    width: calc(100% - 280px);
}

.main-header {
    margin-bottom: 32px;
}

.main-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.main-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger-red);
    margin-bottom: 16px;
}

.modal-warning {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 16px;
    line-height: 1.6;
}

.modal-instruction {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-instruction strong {
    color: var(--text-main);
    font-weight: 700;
}

.clear-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', monospace;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.clear-input:focus {
    outline: none;
    border-color: var(--danger-red);
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 11px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    flex: 1;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: var(--bg-gray);
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    box-shadow: var(--card-shadow);
}

.card.metric h3 {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.value {
    font-size: 32px;
    font-weight: 700;
    color: var(--cf-orange);
    line-height: 1;
}

.value.critical {
    color: #DC2626;
}

.tab-container {
    margin-bottom: 32px;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: -1px;
    border-bottom: 1px solid var(--border-light);
}

.tab-btn {
    background: none;
    border: none;
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--cf-orange);
    border-bottom-color: var(--cf-orange);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.no-padding {
    padding: 0;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 15px;
    background: #FAFBFC;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #FAFBFC;
    padding: 14px 24px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
}

th.col-number {
    width: 60px;
    text-align: center;
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-main);
}

td.col-number {
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
}

td strong {
    font-weight: 700;
}

.summary-cell {
    max-width: 400px;
}

tr.urgency-P1 {
    background-color: var(--p1-red);
}

tr.urgency-P1 td {
    color: var(--p1-text);
    font-weight: 500;
}

tr.urgency-P1 td.col-number {
    color: var(--p1-text);
}

tr.urgency-P2, tr.urgency-P3 {
    background-color: var(--p2-yellow);
}

tbody tr:hover {
    background-color: #F9FAFB;
}

tr.urgency-P1:hover {
    background-color: #FED7D7;
}

tr.urgency-P2:hover, tr.urgency-P3:hover {
    background-color: #FEF08A;
}

.btn-orange {
    background: var(--cf-orange);
    color: white;
    border: none;
    width: 100%;
    padding: 11px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-orange:hover {
    background: #E57518;
}

.btn-dark {
    background: #1F2937;
    color: white;
    border: none;
    width: 100%;
    padding: 11px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn-dark:hover {
    background: #374151;
}

.btn-danger {
    background: var(--danger-red);
    color: white;
    border: none;
    width: 100%;
    padding: 11px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
    flex: 1;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-red-hover);
}

.btn-danger:disabled {
    background: #D1D5DB;
    cursor: not-allowed;
}

.chart-container {
    padding: 20px 0;
}

.stacked-bar {
    display: flex;
    width: 100%;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
    transition: opacity 0.2s;
}

.bar-segment:hover {
    opacity: 0.85;
}

.bar-bug {
    background: #2D7A6E;
}

.bar-feature {
    background: #F59E0B;
}

.bar-support {
    background: #60A5FA;
}

.bar-label {
    white-space: nowrap;
}

.chart-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.chart-legend-center {
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.bg-bug {
    background: #2D7A6E;
}

.bg-feature {
    background: #F59E0B;
}

.bg-support {
    background: #60A5FA;
}

.legend-text {
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-size: 14px;
}

.pie-chart-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.trend-grid-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.trend-section {
    margin-top: 32px;
}

.trend-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

.trend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.trend-grid .card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
}

.trend-grid form select,
.trend-grid form input[type="text"] {
    margin-bottom: 12px;
}