/* Supplier Scorecard Styles */

/* Suppliers Sub-Navigation in Secondary Navbar */
#suppliersSubnav {
    gap: 1.5rem;
}

#suppliersSubnav.show {
    display: flex !important;
}

#suppliersSubnav .subnav-link {
    color: #666 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    padding: 0.3rem 0.6rem !important;
    transition: all 0.3s !important;
    cursor: pointer !important;
    font-size: 13px !important;
    border-radius: 4px !important;
    background-color: transparent !important;
    border-bottom: 2px solid transparent !important;
}

#suppliersSubnav .subnav-link:hover {
    color: #333 !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
    text-decoration: none !important;
}

#suppliersSubnav .subnav-link.active {
    color: #333 !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    border-bottom-color: #3498db !important;
}

/* Suppliers Sub-Pages */
.suppliers-subpage {
    width: 100%;
    max-width: 100%;
}

/* Suppliers Page Background */
#suppliers-page {
    background-color: #104862 !important;
    min-height: 100vh;
    padding-bottom: 100px;
}

#suppliers-page main,
#suppliers-page .main-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #104862;
}

/* Scorecard Container */
.scorecard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #104862;
    min-height: auto;
}

/* White Bounding Box for Scorecard */
.scorecard-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow: hidden;
}

.scorecard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.scorecard-title-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.template-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.template-selector label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin: 0;
}

.template-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    min-width: 200px;
    max-width: 250px;
    width: auto;
    flex-shrink: 0;
    font-weight: 500;
}

.template-select option {
    background: #104862;
    color: white;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

#manageTemplatesBtn {
    width: auto;
    min-width: fit-content;
    flex-shrink: 0;
    padding: 4px 12px;
}

.scorecard-header h1 {
    margin: 0;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9) !important;
    text-align: left;
    text-shadow: none;
    font-weight: 300;
}

.scorecard-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scorecard-actions .btn-group {
    display: flex;
    gap: 10px;
}

.scorecard-actions .btn {
    margin: 0;
}

/* Professional Scorecard Header Buttons */
.scorecard-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px !important;
    min-width: 70px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 8px !important;
    box-shadow: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

/* Override Bootstrap button states for scorecard buttons */
.scorecard-btn.btn-warning {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.scorecard-btn.btn-warning:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.scorecard-btn::before {
    display: none;
}

.scorecard-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

.scorecard-btn:hover::before {
    opacity: 1;
}

.scorecard-btn:active,
.scorecard-btn:focus,
.scorecard-btn.focus {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border-color: #FFBA49 !important;
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(255, 186, 73, 0.2) !important;
}

/* Override Bootstrap's default button states */
.scorecard-btn.btn-warning:not(.focus):not(:focus):not(.active):not(:active):not(:hover) {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Force consistent default appearance for all scorecard buttons */
.scorecard-btn.btn-warning,
.scorecard-btn.btn-primary,
.scorecard-btn.btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.scorecard-btn.focus,
.scorecard-btn:focus {
    outline: none;
}

/* Remove any default focus styling */
.scorecard-btn:focus:not(:focus-visible) {
    box-shadow: none;
}

.btn-icon {
    font-size: 18px;
    line-height: 1;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 1;
}

.btn-text {
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    padding-top: 5px;
    z-index: 1;
    color: rgba(255, 255, 255, 0.8);
}

/* Supplier Information and Score Container */
.supplier-info-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Supplier Information Grid */
.supplier-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Overall Score Section */
.overall-score-section {
    display: flex;
    align-items: stretch;
    min-width: 200px;
    padding: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Overall Score Display */
.overall-score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-height: 140px;
    justify-content: center;
    width: 100%;
}

.overall-score-display label {
    font-weight: bold;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.current-score {
    font-size: 48px;
    font-weight: bold;
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1;
}

.score-history {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.score-history-label {
    font-weight: 500;
}

.past-scores {
    display: flex;
    gap: 4px;
}

.past-score {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

.score-separator {
    color: rgba(255, 255, 255, 0.3);
    font-weight: normal;
}

.info-field {
    display: flex;
    flex-direction: column;
}

.info-field label {
    font-weight: bold;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.info-field input, .info-field select {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 14px;
    color: white;
    transition: border-color 0.3s;
}

.info-field input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.info-field select option {
    background: #104862;
    color: white;
}

.info-field input:focus, .info-field select:focus {
    outline: none;
    border-color: #FFBA49;
    box-shadow: 0 0 0 3px rgba(255, 186, 73, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

/* Global scorecard placeholder and form text visibility */
.scorecard-wrapper input::placeholder,
.scorecard-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.scorecard-wrapper input,
.scorecard-wrapper select,
.scorecard-wrapper textarea {
    color: rgba(255, 255, 255, 0.9);
}

.scorecard-wrapper select option {
    background: #104862;
    color: white;
}

/* Category Styles */
.category {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

.category-header {
    background: linear-gradient(135deg, #114762, #0d3a50);
    color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-weight {
    display: flex;
    align-items: center;
    gap: 5px;
}

.category-weight-input {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 60px;
    text-align: center;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 14px;
}

.category-weight-input:focus {
    background: rgba(255,255,255,0.3);
    outline: none;
}

.category-content {
    padding: 20px;
    color: rgba(255, 255, 255, 0.85);
}

/* Add right padding in edit mode to prevent overlap with eye icons */
.edit-mode .category-content {
    padding-right: 60px;
}

.metric {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 15px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

/* In edit mode, adjust grid to include eye icon column */
.edit-mode .metric {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 40px; /* Add column for eye icon */
    padding-right: 0; /* Remove padding since we have a dedicated column */
}

.metric:last-child {
    border-bottom: none;
}

.metric-name {
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.metric-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-weight {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
}

/* Help Icon for Metric Descriptions */
.help-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: rgba(255, 186, 73, 0.8);
    color: #104862;
    border-radius: 50%;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    line-height: 16px;
    cursor: help;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent the icon from shrinking */
}

.help-icon:hover {
    background-color: #FFBA49;
    transform: scale(1.1);
}

.metric-weight-input {
    width: 50px;
    font-size: 12px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 3px;
    text-align: center;
}

.metric input, .metric select {
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.metric input:focus, .metric select:focus {
    outline: none;
    border-color: #FFBA49;
    box-shadow: 0 0 0 3px rgba(255, 186, 73, 0.2);
}

.metric-target {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.target-input {
    width: 80px;
    font-size: 12px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 3px;
    text-align: center;
    margin-top: 2px;
}

/* Score Display */
.score {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    text-align: center;
    color: white !important;
    font-size: 14px;
    min-width: 40px;
    display: inline-block;
}

.score.score-excellent { background-color: #27ae60 !important; }
.score.score-good { background-color: #f39c12 !important; }
.score.score-acceptable { background-color: #e67e22 !important; }
.score.score-needs-improvement { background-color: #e74c3c !important; }
.score.score-unacceptable { background-color: #c0392b !important; }

.score.score-blank,
.category-score.score-blank,
.performance-level.score-blank {
    background-color: transparent !important;
    color: #999 !important;
    font-style: italic;
}

.category-score {
    font-size: 18px;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 25px;
    color: white !important;
    min-width: 60px;
    text-align: center;
    display: inline-block;
}

/* Category score color classes */
.category-score.score-excellent { background-color: #27ae60 !important; }
.category-score.score-good { background-color: #f39c12 !important; }
.category-score.score-acceptable { background-color: #e67e22 !important; }
.category-score.score-needs-improvement { background-color: #e74c3c !important; }
.category-score.score-unacceptable { background-color: #c0392b !important; }

/* Summary Section */
.scorecard-summary {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.overall-score {
    text-align: center;
    margin-bottom: 20px;
}

.overall-score-number {
    font-size: 48px;
    font-weight: bold;
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.95);
}

.performance-level {
    font-size: 18px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    color: white;
}

.action-plan {
    margin-top: 20px;
}

.action-plan h3 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.action-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.action-plan-header h3 {
    margin: 0;
}

.action-plan-header .btn {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 13px;
    margin-left: 10px;
    max-width: 150px;
}

.scorecard-action-items {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 15px;
    min-height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scorecard-action-items .loading-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 20px 0;
}

.scorecard-action-items .empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 20px 0;
}

.scorecard-action-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scorecard-action-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.scorecard-action-item:last-child {
    margin-bottom: 0;
}

.scorecard-action-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.scorecard-action-item-title {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 14px;
}

.scorecard-action-item-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.scorecard-action-item-status.open {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.scorecard-action-item-status.in-progress {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.scorecard-action-item-status.completed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.scorecard-action-item-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.scorecard-action-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.scorecard-action-item-due {
    font-weight: 500;
}

.scorecard-action-item-due.overdue {
    color: #e74c3c;
    font-weight: 600;
}

.action-plan textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    resize: vertical;
}

.action-plan textarea:focus {
    outline: none;
    border-color: #FFBA49;
    box-shadow: 0 0 0 3px rgba(255, 186, 73, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.scorecard-actions-bottom {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.last-updated {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Edit Mode Styles */
.edit-mode .category-weight-input,
.edit-mode .metric-weight-input,
.edit-mode .target-input {
    display: inline-block;
}

.category-weight-input,
.metric-weight-input,
.target-input {
    display: none;
}

.edit-mode .category-weight-display,
.edit-mode .metric-weight-display,
.edit-mode .target-display {
    display: none;
}

.edit-mode .target-editor {
    display: flex !important;
}

/* Target Editor Styles */
.target-editor {
    display: none;
    flex-direction: row;
    gap: 3px;
    width: 100%;
}

.target-operator {
    padding: 3px 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 3px;
    font-size: 11px;
    text-align: center;
    width: 40px;
    flex-shrink: 0;
}

.target-value {
    padding: 3px 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 3px;
    font-size: 11px;
    text-align: center;
    width: 50px;
    flex-shrink: 0;
}

.target-unit {
    padding: 3px 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 3px;
    font-size: 11px;
    text-align: center;
    width: 30px;
    flex-shrink: 0;
}

/* Select Container Styles */
.select-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.select-container select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.btn-edit-options {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-edit-options:hover {
    background-color: #138496;
}

/* Options Editor Styles */
.options-editor {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.options-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
}

.options-column-headers {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 8px;
    margin-bottom: 10px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.header-points {
    text-align: center;
}

.header-description {
    text-align: left;
}

.header-actions {
    text-align: center;
}

.btn-add-option {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-add-option:hover {
    background-color: #218838;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.option-value {
    text-align: center;
    font-size: 12px;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 3px;
}

.option-label {
    font-size: 12px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 3px;
}

.btn-remove-option {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.btn-remove-option:hover {
    background-color: #c82333;
}

/* Placeholder Content */
.placeholder-content {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.placeholder-content ul {
    list-style: none;
    padding: 0;
    margin-top: 30px;
}

.placeholder-content li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.placeholder-content li:last-child {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .scorecard-container {
        padding: 10px;
    }

    .supplier-info-container {
        grid-template-columns: 1fr;
    }

    .supplier-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .overall-score-section {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 15px;
    }

    .metric {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
        padding-right: 0;
    }

    .edit-mode .metric {
        grid-template-columns: 1fr 30px; /* Simplified grid for mobile */
        gap: 10px;
    }

    .metric .visibility-toggle {
        justify-self: center;
        align-self: center;
    }

    .scorecard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .scorecard-actions {
        justify-content: center;
    }

    .scorecard-actions-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .last-updated {
        margin-left: 0;
        text-align: center;
    }
}

/* Modal Close Button Fix */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header .close {
    padding: 0.5rem;
    margin: 0;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
    margin-left: auto;
    width: 30px;
}

.modal-header .close:hover {
    opacity: 0.75;
}

.modal-header .close span {
    display: block;
    width: 1rem;
    height: 1rem;
}

/* Form Check Fix */
.form-check {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 0.5rem;
    padding-left: 0 !important;
    width: 100%;
    text-align: left !important;
}

.form-check-input {
    margin: 0 !important;
    margin-right: 0.5rem !important;
    flex-shrink: 0;
    position: static !important;
    margin-top: 0.125rem !important;
    order: 1;
    width: 20px;
}

/* Supplier Dropdown Styles */
.supplier-dropdown-container {
    position: relative;
    display: flex;
}

.supplier-dropdown-container input {
    flex: 1;
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.supplier-dropdown-btn {
    width: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.supplier-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.supplier-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    color: #2c3e50;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.supplier-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.supplier-dropdown-item:hover,
.supplier-dropdown-item.selected {
    background: #f8f9fa;
}

.supplier-dropdown-item:last-child {
    border-bottom: none;
}

.supplier-dropdown-loading {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.supplier-dropdown-add-new {
    padding: 8px 12px;
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
    border-bottom: 1px solid #bbdefb;
    cursor: pointer;
}

.supplier-dropdown-add-new:hover,
.supplier-dropdown-add-new.selected {
    background: #bbdefb;
}

.supplier-dropdown-no-results {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Evaluation Navigation Styles */
.evaluation-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: -10px;
    margin-bottom: -20px;
    font-size: 14px;
    width: auto;
    max-width: 150px;
    margin-left: auto;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-link:hover:not(.disabled) {
    color: white;
    text-decoration: underline;
}

.nav-link.disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    text-decoration: none;
}

.nav-separator {
    color: rgba(255, 255, 255, 0.3);
    font-weight: normal;
}

.form-check-label {
    margin: 0 !important;
    cursor: pointer;
    padding-left: 0 !important;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left !important;
    order: 2;
}

/* Bulk Upload Styles */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    background-color: #fafafa;
}

.file-upload-area:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.file-upload-area.dragover {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.file-upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.file-upload-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.file-upload-info {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.upload-options {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.preview-section {
    margin-top: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.preview-stats {
    background-color: white;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
    font-weight: 500;
}

.preview-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.preview-table-container table {
    margin: 0;
    font-size: 12px;
}

.preview-table-container th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    font-weight: 600;
    padding: 8px 12px;
    border-bottom: 2px solid #ddd;
}

.preview-table-container td {
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.progress-section {
    margin-top: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 600;
    color: #495057;
    min-width: 40px;
}

.upload-status {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 4px solid #17a2b8;
}

.status-label {
    font-weight: 500;
    color: #495057;
}

.upload-errors {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

.upload-errors h5 {
    color: #856404;
    margin-bottom: 10px;
}

.upload-errors ul {
    margin: 0;
    padding-left: 20px;
}

.upload-errors li {
    color: #721c24;
    margin-bottom: 5px;
}

.modal-content.large {
    max-width: 800px;
    width: 90%;
}

/* Responsive adjustments for bulk upload */
@media (max-width: 768px) {
    .upload-status {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .progress-bar-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .modal-content.large {
        width: 95%;
        max-width: none;
    }
}

/* Print Styles */
@media print {
    .scorecard-actions,
    .scorecard-actions-bottom,
    .subnav-links {
        display: none !important;
    }

    .scorecard-container {
        padding: 0;
        background: white;
        box-shadow: none;
    }

    .scorecard-wrapper {
        background: white;
        border: none;
    }

    .category {
        background: white;
        border: 1px solid #ddd;
        break-inside: avoid;
        margin-bottom: 15px;
    }

    .scorecard-header h1 {
        color: #333 !important;
    }

    .metric-name,
    .info-field label,
    .overall-score-display label,
    .current-score,
    .overall-score-number,
    .action-plan h3 {
        color: #333 !important;
    }

    .category-content,
    .metric-target,
    .metric-weight,
    .score-history,
    .last-updated {
        color: #666 !important;
    }
}

/* Status Indicator Styles */
.scorecard-status-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    margin-top: 10px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.status-badge.draft {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.status-badge.final {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.status-icon {
    font-size: 16px;
    line-height: 1;
}

.status-text {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-toggle-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 186, 73, 0.3);
    border-radius: 6px;
    color: #FFBA49;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.9;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.status-toggle-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 186, 73, 0.2) 0%, rgba(255, 186, 73, 0.1) 100%);
    border-color: rgba(255, 186, 73, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.status-toggle-btn i {
    transition: color 0.3s ease;
}

.status-toggle-btn.active i {
    color: #28a745;
}


/* Status-based form disabling */
.scorecard-wrapper.status-final .form-control,
.scorecard-wrapper.status-final .score-input,
.scorecard-wrapper.status-final .weight-input,
.scorecard-wrapper.status-final select,
.scorecard-wrapper.status-final textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    opacity: 0.6;
    cursor: not-allowed;
}

.scorecard-wrapper.status-completed .form-control,
.scorecard-wrapper.status-completed .score-input,
.scorecard-wrapper.status-completed .weight-input,
.scorecard-wrapper.status-completed select,
.scorecard-wrapper.status-completed textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Keep navigation elements and supplier-level settings looking normal even when locked */
.scorecard-wrapper.status-final #supplierName,
.scorecard-wrapper.status-final #evalPeriod,
.scorecard-wrapper.status-final #templateSelect,
.scorecard-wrapper.status-final .template-select,
.scorecard-wrapper.status-final #evaluationRecurrence,
.scorecard-wrapper.status-final #customRecurrenceMonths,
.scorecard-wrapper.status-completed #supplierName,
.scorecard-wrapper.status-completed #evalPeriod,
.scorecard-wrapper.status-completed #templateSelect,
.scorecard-wrapper.status-completed .template-select,
.scorecard-wrapper.status-completed #evaluationRecurrence,
.scorecard-wrapper.status-completed #customRecurrenceMonths {
    background: rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

.scorecard-wrapper.status-final .btn:not(.status-toggle-btn):not(#statusToggleBtn) {
    opacity: 0.5;
    cursor: not-allowed;
}

.scorecard-wrapper.status-completed .btn:not(.status-toggle-btn):not(#statusToggleBtn) {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Keep New, Upload, and navigation buttons looking normal */
.scorecard-wrapper.status-final #newEvaluationBtn,
.scorecard-wrapper.status-final #bulkUploadBtn,
.scorecard-wrapper.status-final #prevEvaluationBtn,
.scorecard-wrapper.status-final #nextEvaluationBtn,
.scorecard-wrapper.status-completed #newEvaluationBtn,
.scorecard-wrapper.status-completed #bulkUploadBtn,
.scorecard-wrapper.status-completed #prevEvaluationBtn,
.scorecard-wrapper.status-completed #nextEvaluationBtn {
    opacity: 1 !important;
    cursor: pointer !important;
}

/* Category Header Layout */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Visibility Toggle Buttons */
.visibility-toggle {
    background: transparent;
    border: 1px solid rgba(255, 186, 73, 0.3);
    border-radius: 4px;
    color: #FFBA49;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    line-height: 1;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Position eye icons in grid column for metrics */
.metric .visibility-toggle {
    justify-self: center;
    align-self: center;
}

/* Category eye icons stay in header-right container */
.category-header-right .visibility-toggle {
    /* Keep existing positioning in category header */
}

.visibility-toggle:hover {
    background: rgba(255, 186, 73, 0.1);
    border-color: rgba(255, 186, 73, 0.5);
    transform: scale(1.05);
}

.visibility-toggle.visibility-hidden {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.1);
}

/* Hidden Elements Styling */
.category-hidden,
.metric-hidden {
    display: none; /* Completely hide in non-edit mode */
}

/* In edit mode, show hidden elements with reduced opacity */
.edit-mode .category-hidden {
    display: block;
    opacity: 0.4;
    filter: grayscale(0.6);
    transition: all 0.3s ease;
}

.edit-mode .metric-hidden {
    display: grid; /* Maintain grid layout for metrics */
    opacity: 0.4;
    filter: grayscale(0.6);
    transition: all 0.3s ease;
}

.category-hidden .category-header,
.metric-hidden .metric-name {
    position: relative;
}

.category-hidden .category-header::after,
.metric-hidden .metric-name::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%);
    pointer-events: none;
}

/* Hidden score styling */
.hidden-score {
    color: #666 !important;
    font-style: italic;
}

/* Show visibility toggles only in edit mode */
.edit-mode .visibility-toggle.edit-mode-only {
    display: inline-flex !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scorecard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .visibility-toggle {
        font-size: 12px;
        min-width: 20px;
        height: 18px;
    }
}

    .scorecard-status-indicator {
        align-items: flex-start;
        margin-top: 15px;
    }

}