/* prioriti-scorecard.html — page-specific styles */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0b0e13 0%, #141c28 100%);
  min-height: 100vh;
  color: #c9d2dc;
  line-height: 1.6;
}
.container { max-width: 1400px; margin: 0 auto; padding: 32px; }
.grid { display: grid; gap: 24px; }
.top-grid { grid-template-columns: 1.5fr .8fr; }
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.hero-title { display: flex; gap: 16px; align-items: flex-start; }
.icon-box {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2b8be6, #5468f2);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex: 0 0 auto;
  box-shadow: 0 4px 15px rgba(43,139,230,0.3);
}
h1, h2, h3 { margin: 0 0 8px; color: white; }
h1 {
  font-size: 28px; line-height: 1.2;
  background: linear-gradient(135deg, #ff6b00, #ff9933);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
h2 { font-size: 20px; font-weight: 600; color: #2b8be6; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; color: rgba(255, 255, 255, 0.7); line-height: 1.5; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.metric {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.metric .label { font-size: 13px; color: rgba(255, 255, 255, 0.6); margin-bottom: 8px; }
.metric .value { font-size: 22px; font-weight: 700; color: white; }
.tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tab-btn {
  flex: 1;
  border: 0; background: transparent;
  padding: 16px 24px; border-radius: 0; cursor: pointer;
  font-weight: 500; font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  position: relative;
}
.tab-btn:hover { color: white; background: rgba(255, 255, 255, 0.05); }
.tab-btn.active {
  color: white;
  background: linear-gradient(135deg, rgba(43,139,230,0.3), rgba(84,104,242,0.3));
  box-shadow: 0 4px 20px rgba(84,104,242,0.3);
}
.tab-btn.active::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2b8be6, #5468f2);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeInUp 0.4s ease-out; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.two-col { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; }
.two-col-wide { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); text-align: left; }
th { font-size: 13px; color: rgba(255, 255, 255, 0.6); font-weight: 600; }
td { color: #c9d2dc; }
tr { transition: all 0.3s ease; cursor: pointer; }
tr:hover { background: rgba(255, 255, 255, 0.05); }
tr.selected { background: linear-gradient(135deg, rgba(43,139,230,0.2), rgba(84,104,242,0.2)); }
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(43,139,230,0.2);
  color: #5aa6ee;
  font-size: 12px; font-weight: 600;
  border: 1px solid rgba(43,139,230,0.3);
}
.control-row { margin-bottom: 18px; }
.control-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.control-top label { color: rgba(255, 255, 255, 0.9); }
.control-top strong { color: #2b8be6; }
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: linear-gradient(135deg, #2b8be6, #5468f2);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(43,139,230,0.4);
}
.btn {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  cursor: pointer; font-weight: 600; color: white;
  transition: all 0.3s ease;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
.btn.active {
  background: linear-gradient(135deg, #2b8be6, #1a62ad);
  color: white; border-color: transparent;
  box-shadow: 0 4px 15px rgba(43,139,230,0.3);
}
.btn.outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn.outline:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 8px; font-weight: 500; color: rgba(255, 255, 255, 0.9); }
.field input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: all 0.3s ease;
}
.field input:focus {
  outline: none;
  border-color: #2b8be6;
  box-shadow: 0 0 0 2px rgba(43,139,230,0.3);
}
.field input::placeholder { color: rgba(255, 255, 255, 0.5); }
.vendor-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}
.vendor-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.small-note {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.chart-container {
  position: relative;
  height: 260px;
  min-height: 180px;
  width: 100%;
}
.chart-container canvas {
  max-width: 100%;
  display: block;
}
@media (max-width: 1100px) {
  .top-grid, .two-col, .two-col-wide, .chart-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .vendor-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-container { height: 220px; min-height: 160px; }
}
@media (max-width: 640px) {
  .metrics, .vendor-grid, .btn-row { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .tabs { flex-direction: column; }
  .chart-container { height: 200px; min-height: 140px; }
}

/* Sidebar & layout from scorecard.html */
.app-container { display: flex; min-height: 100vh; }
.sidebar {
  width: 280px; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1); color: white; padding: 24px 0;
  box-shadow: 2px 0 25px rgba(0,0,0,0.3); transition: all 0.3s ease;
  overflow-y: auto; flex-shrink: 0;
}
.sidebar.collapsed { width: 80px; }
.app-container .sidebar.collapsed ~ .main-content .content { max-width: calc(100vw - 80px); transition: max-width 0.3s ease; }

.logo { display: flex; align-items: center; font-size: 20px; font-weight: 600; color: white;
  background: linear-gradient(135deg, #ff6b00, #ff9933); background-clip: text;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo img { height: 32px; }

.header-buttons { margin-top: 16px; }
.header-btn {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px; color: #8c99a8; cursor: pointer; font-size: 13px;
    font-weight: 500; transition: all 0.3s ease; width: 100%;
}
.header-btn:hover { background: rgba(43,139,230,0.2); border-color: #2b8be6; color: #2b8be6; }
.header-btn .material-icons { font-size: 18px; }

.nav-item {
  display: flex; align-items: center; padding: 12px 24px; cursor: pointer; transition: all 0.3s ease;
  border: none; background: none; color: white; width: 100%; text-align: left;
  border-radius: 0 25px 25px 0; margin: 4px 0;
}

.nav-item.section-header {
  background: rgba(43,139,230,0.2); border-left: 4px solid #2b8be6; color: #2b8be6;
  font-weight: 600; margin: 8px 0 4px 0; box-shadow: 0 4px 15px rgba(43,139,230,0.2);
}
.nav-item.active-page {
  background: linear-gradient(135deg, rgba(43,139,230,0.3), rgba(84,104,242,0.3));
  border-left: 4px solid #5468f2; color: white; font-weight: 500; box-shadow: 0 4px 20px rgba(84,104,242,0.3);
}
.nav-item .material-icons { margin-right: 12px; font-size: 20px; flex-shrink: 0; }
.sidebar.collapsed .nav-text { display: none; }
.sidebar.collapsed .expand-icon { display: none; }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; }
.expand-icon { margin-left: auto; transition: transform 0.3s ease; font-size: 18px; flex-shrink: 0; }
.nav-item.section-header.expanded .expand-icon { transform: rotate(90deg); }
.nav-item.section-header.expanded { background: #26303f; }
.nav-subitems { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; background: #26303f; backdrop-filter: blur(10px); }
.nav-subitems.expanded { max-height: 1000px; }
.sidebar.collapsed .nav-subitems { display: none; }
.nav-subitems .nav-item { background: transparent; padding-left: 52px; font-weight: 400; margin: 2px 0; }
.nav-subitems .nav-item:hover { background: rgba(255,255,255,0.1); transform: translateX(8px); }
.nav-subitems .nav-item.active-page { background: rgba(84,104,242,0.2); border-left: 3px solid #5468f2; }
.main-content { flex: 1; display: flex; flex-direction: column; background: rgba(255,255,255,0.02); min-width: 0; overflow: hidden; }
.header {
  background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 32px; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: space-between;
}
.header-left { display: flex; align-items: center; }
.header-title { font-size: 28px; font-weight: 700; margin-left: 20px;
  background: linear-gradient(135deg, #ff6b00, #ff9933); background-clip: text;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.header-right { display: flex; align-items: center; gap: 20px; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.content { padding: 32px; flex: 1; overflow-y: auto; max-width: calc(100vw - 280px); width: 100%; }
.sidebar.collapsed + .main-content .content { max-width: calc(100vw - 80px); }
.btn-primary { background: linear-gradient(135deg, #2b8be6, #1a62ad); color: white; border: none; padding: 12px 24px; border-radius: 8px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary { background: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255, 255, 255, 0.2); padding: 12px 24px; border-radius: 8px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }
@media (max-width: 768px) { .sidebar { width: 80px; } .sidebar .nav-text { display: none; } .header-title { font-size: 20px; } }

/* ─── AI Recommendation Modal ─── */
.recommend-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
    z-index: 2000; align-items: center; justify-content: center;
}

.recommend-modal {
    background: linear-gradient(135deg, #0b0e13 0%, #141c28 100%);
    border: 1px solid rgba(84,104,242,0.3);
    border-radius: 20px; padding: 0; width: 700px; max-width: 95vw;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 40px rgba(84,104,242,0.15);
    overflow: hidden;
}
.recommend-modal-header {
    background: linear-gradient(135deg, #5468f2, #4255d9);
    padding: 20px 24px; display: flex; align-items: center; justify-content: space-between;
    color: white;
}
.recommend-modal-header h3 { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.recommend-modal-header h3 .material-icons { font-size: 24px; }
.recommend-modal-close {
    background: rgba(255,255,255,0.15); border: none; color: white; cursor: pointer;
    padding: 8px; border-radius: 50%; width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.recommend-modal-close:hover { background: rgba(255,255,255,0.25); }
.recommend-modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.recommend-input-row {
    display: flex; gap: 12px; align-items: center; margin-bottom: 20px;
}
.recommend-input {
    flex: 1; padding: 14px 20px;
    background: rgba(255,255,255,0.05); border: 2px solid rgba(84,104,242,0.3);
    border-radius: 14px; font-size: 15px; color: #f2f5f9;
    outline: none; transition: all 0.3s; font-family: 'Inter', sans-serif;
}
.recommend-input:focus { border-color: #5468f2; background: rgba(84,104,242,0.1); box-shadow: 0 0 0 4px rgba(84,104,242,0.15); }
.recommend-input::placeholder { color: #838f9f; }
.recommend-ai-btn {
    width: 50px; height: 50px; border-radius: 50%;
    border: 2px solid rgba(84,104,242,0.5);
    background: linear-gradient(135deg, rgba(84,104,242,0.3), rgba(66,85,217,0.4));
    color: #b8c1fa; cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.3s;
}
.recommend-ai-btn:hover {
    background: linear-gradient(135deg, rgba(84,104,242,0.5), rgba(66,85,217,0.6));
    border-color: #8c9bf7; color: white; transform: scale(1.08);
    box-shadow: 0 0 20px rgba(84,104,242,0.5);
}
.recommend-ai-btn.loading { pointer-events: none; animation: sparkle-pulse 1.2s ease-in-out infinite; }
@keyframes sparkle-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.05); } }
.recommend-ai-btn .material-icons { font-size: 24px; }
.recommend-results {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 24px; min-height: 120px; color: #c9d2dc;
    line-height: 1.7; font-size: 14px;
    max-height: 55vh; overflow-y: auto; scroll-behavior: smooth;
}

.recommend-apply-btn.loading::after {
    content: ''; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: rgba(201,209,220,.14); border-radius: 50%; animation: applyBtnSpin 0.8s linear infinite; margin-left: 6px;
}

.recommend-chip {
    padding: 8px 16px; background: rgba(84,104,242,0.1);
    border: 1px solid rgba(84,104,242,0.25); border-radius: 20px;
    font-size: 12px; cursor: pointer; transition: all 0.3s; color: #8c9bf7;
}
.recommend-chip:hover { background: rgba(84,104,242,0.25); border-color: #5468f2; color: #b8c1fa; }
@media print {
    body * { visibility: hidden; }
    #recommendResults, #recommendResults * { visibility: visible; }
    #recommendResults {
        position: absolute; left: 0; top: 0; width: 100%;
        background: #fff !important; color: #141c28 !important;
        border: none !important; padding: 30px !important;
        font-size: 13px !important; line-height: 1.6 !important;
    }
    #recommendResults h2 { color: #0c21a6 !important; border-bottom: 2px solid #5468f2 !important; }
    #recommendResults h3 { color: #1431ed !important; }
    #recommendResults p, #recommendResults li { color: #1c2430 !important; }
    #recommendResults strong { color: #000 !important; }
    #recommendResults ul li::marker { color: #4255d9 !important; }
    .recommend-print-btn { display: none !important; }
}

.issues-tracker-form {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
    max-height: calc(90vh - 80px);
}

.issues-tracker-form .form-group {
    margin-bottom: 20px;
}

.form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.form-success {
    text-align: center;
    padding: 40px 20px;
    color: #10b981;
}

.form-success .material-icons {
    font-size: 48px;
    margin-bottom: 16px;
}

.form-success h3 {
    margin-bottom: 8px;
    color: #f2f5f9;
}

.form-success p {
    color: #8c99a8;
    font-size: 14px;
}

.issues-tracker-form .hidden {
    display: none !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pria Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
}

.chatbot-trigger {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #2b8be6, #5468f2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(43,139,230,0.4);
    transition: all 0.3s ease;
    border: none;
    color: white;
    animation: chatbotPulse 3s infinite;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(43,139,230,0.5);
}

.chatbot-trigger .material-icons {
    font-size: 32px;
}

.chatbot-window {
    position: fixed;
    bottom: 122px;
    right: 32px;
    width: 380px;
    height: calc(100vh - 210px);
    max-height: calc(100vh - 210px);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.chatbot-header {
    background: linear-gradient(135deg, #2b8be6, #5468f2);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
}

.message {
    margin-bottom: 20px;
    animation: messageSlideIn 0.4s ease;
}

.message.user {
    display: flex;
    justify-content: flex-end;
}

.chatbot-input-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.claude-api-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}
.claude-api-bar label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
}
.claude-api-bar input {
    flex: 1;
    min-width: 180px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #c9d2dc;
    padding: 8px 12px;
    font-size: 13px;
}
.claude-api-bar input:focus {
    border-color: #5468f2;
    outline: none;
}
.claude-api-bar input::placeholder {
    color: rgba(255,255,255,0.35);
}
.claude-api-bar button {
    background: linear-gradient(135deg, #2b8be6, #5468f2);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
}
.claude-api-bar button:hover { opacity: 0.9; }
.claude-api-bar button.connected {
    background: linear-gradient(135deg, #059669, #10b981);
}
.claude-api-bar.hidden {
    display: none !important;
}

.message.bot .message-content.ai-styled .ai-response {
    line-height: 1.7;
    color: #ffffff;
    font-size: 13px;
}

.quick-action {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #8c99a8;
}

.quick-action:hover {
    background: rgba(43,139,230,0.2);
    border-color: #2b8be6;
    color: #2b8be6;
}

.typing-indicator {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    animation: messageSlideIn 0.4s ease;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(23,30,39,0.6);
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .chatbot-window {
        width: 350px;
        height: calc(100vh - 190px);
        max-height: calc(100vh - 190px);
        right: 16px;
        bottom: 80px;
    }

    .chatbot-container {
        bottom: 16px;
        right: 16px;
    }
}
