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

body {
    font-family: 'Amazon Ember', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #232f3e;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: #ffffff;
    padding: 24px;
    padding-bottom: 0;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #d5dbdb;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: padding 0.3s ease;
}

header.compact {
    padding: 12px 24px;
    padding-bottom: 0;
    border-radius: 0;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: #e9ebed;
    margin-top: 16px;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

header.compact .progress-bar-container {
    border-radius: 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0972d3 0%, #067f68 100%);
    width: 0%;
    transition: width 0.3s linear;
}

header.compact .chart-container {
    display: none;
}

header.compact .header-bottom {
    gap: 16px;
    align-items: center;
}

header.compact .stats-section {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    min-width: auto;
}

header.compact .header-title-row {
    margin-bottom: 8px;
}

header.compact h1 {
    font-size: 20px;
}

.header-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

h1 {
    color: #16191f;
    margin: 0;
    font-weight: 700;
    font-size: 28px;
}

.header-automation-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.automation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #e6f2ff;
    border: 1px solid #0972d3;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #033160;
}

.automation-badge-icon {
    font-size: 10px;
}

.header-bottom {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.stats-section {
    flex: 1;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-row {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.chart-container {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    height: 200px;
    background: #f2f3f3;
    border-radius: 4px;
    padding: 12px;
    border: 1px solid #d5dbdb;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f6b7a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-sublabel {
    margin-top: 8px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #d13212;
}

.stat-value.stat-version {
    color: #037f0c;
}

.stat-value.stat-time {
    color: #0972d3;
    font-size: 18px;
}

.header-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-selector {
    padding: 4px 8px;
    border: 1px solid #d5dbdb;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Amazon Ember', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: white;
    color: #16191f;
    cursor: pointer;
    transition: border-color 0.2s;
}

.language-selector:focus {
    outline: none;
    border-color: #0972d3;
    box-shadow: 0 0 0 2px rgba(9, 114, 211, 0.1);
}

.time-controls {
    display: flex;
    gap: 8px;
}

.btn-control {
    padding: 2px 10px;
    font-size: 11px;
    line-height: 1.2;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: 'Amazon Ember', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: #037f0c;
    color: white;
    border: 1px solid #037f0c;
}

.btn-primary:hover:not(:disabled) {
    background: #025a09;
}

.btn-secondary {
    background: #ec7211;
    color: white;
    border: 1px solid #ec7211;
}

.btn-secondary:hover:not(:disabled) {
    background: #d45b07;
}

.btn-danger {
    background: #d13212;
    color: white;
    border: 1px solid #d13212;
}

.btn-danger:hover {
    background: #ba2e0f;
}

.btn-success {
    background: #0972d3;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    border: 1px solid #0972d3;
}

.btn-success:hover {
    background: #0762b7;
}

.btn-speed {
    background: #8456ce;
    color: white;
    border: 1px solid #8456ce;
}

.btn-speed:hover:not(:disabled) {
    background: #6f42c1;
}

.btn-bulk {
    background: #ec7211;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid #ec7211;
}

.btn-bulk:hover {
    background: #d45b07;
}

.automation-section {
    background: #f2f3f3;
    border-radius: 4px;
    margin: 20px 0;
    border: 1px solid #d5dbdb;
    overflow: hidden;
}

.automation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.automation-header:hover {
    background: #e9ebed;
}

.automation-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.automation-section h3 {
    color: #16191f;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.automation-indicator {
    font-size: 12px;
    color: #5f6b7a;
    font-weight: 500;
}

.expand-icon {
    font-size: 14px;
    color: #5f6b7a;
    transition: transform 0.3s ease;
}

.expand-icon.collapsed {
    transform: rotate(-90deg);
}

.automation-content {
    padding: 0 20px 20px 20px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.automation-content.collapsed {
    max-height: 0;
    padding: 0 20px;
}

.toggle-option {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.toggle-option input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-option label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.toggle-option label strong {
    color: #16191f;
    font-size: 14px;
}

.toggle-description {
    color: #5f6b7a;
    font-size: 12px;
    font-weight: normal;
}

.bulk-update-container {
    text-align: center;
    margin-bottom: 20px;
}

.unified-btn {
    background: #067f68;
    border: 1px solid #067f68;
}

.unified-btn:hover:not(:disabled) {
    background: #055d4f;
}

.health-indicators {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.health-card {
    background: white;
    border-radius: 6px;
    padding: 8px 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    border: 1px solid #d5dbdb;
}

.health-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.health-card.healthy {
    border-left: 4px solid #037f0c;
}

.health-card.obsolete {
    border-left: 4px solid #ec7211;
}

.health-card.at-risk {
    border-left: 4px solid #d13212;
}

.health-icon {
    font-size: 18px;
    line-height: 1;
}

.health-card.healthy .health-icon {
    color: #037f0c;
}

.health-card.obsolete .health-icon {
    color: #ec7211;
}

.health-card.at-risk .health-icon {
    color: #d13212;
}

.health-count {
    font-size: 16px;
    font-weight: 700;
    color: #16191f;
}

.health-label {
    font-size: 13px;
    color: #5f6b7a;
    font-weight: 600;
}

.setup-screen {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #d5dbdb;
}

.setup-screen h2 {
    color: #16191f;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 700;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setup-form label {
    font-weight: 600;
    color: #16191f;
}

.setup-form input, .setup-form select {
    padding: 10px 12px;
    border: 1px solid #d5dbdb;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Amazon Ember', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: border-color 0.2s;
}

.setup-form input:focus, .setup-form select:focus {
    outline: none;
    border-color: #0972d3;
    box-shadow: 0 0 0 2px rgba(9, 114, 211, 0.1);
}

.clusters-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.cluster-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #d5dbdb;
}

.cluster-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cluster-card.status-current {
    border-left: 6px solid #037f0c;
}

.cluster-card.status-warning {
    border-left: 6px solid #ec7211;
}

.cluster-card.status-critical {
    border-left: 6px solid #d13212;
}

.cluster-card.high-risk-mismatch {
    animation: flashRed 1s infinite;
}

@keyframes flashRed {
    0%, 100% {
        border-left-color: #d13212;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        border-left-color: #ba2e0f;
        box-shadow: 0 4px 16px rgba(209, 50, 18, 0.4);
    }
}

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

.cluster-name {
    font-size: 18px;
    font-weight: 700;
    color: #16191f;
}

.cluster-cost-breakdown {
    text-align: right;
    font-size: 12px;
    color: #5f6b7a;
}

.cluster-cost-breakdown .extended-cost {
    color: #d13212;
    font-weight: 600;
}

.cluster-cost-breakdown .total-cost {
    font-size: 14px;
    font-weight: 700;
    color: #d13212;
    margin-top: 2px;
}

.cluster-info {
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: #5f6b7a;
}

.info-label {
    font-weight: 600;
}

.version-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.version-current {
    background: #037f0c;
    color: white;
}

.version-behind-1 {
    background: #ec7211;
    color: white;
}

.version-behind-2 {
    background: #d45b07;
    color: white;
}

.version-behind-3 {
    background: #d13212;
    color: white;
}

.warnings-container {
    min-height: 80px;
    margin-bottom: 15px;
}

.warning-message {
    background: #fef6e7;
    border: 1px solid #ec7211;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #7d4e00;
}

.warning-message.critical-warning {
    background: #fce8e6;
    border: 2px solid #d13212;
    color: #5c1e0f;
    font-weight: 600;
}

.resolving-message {
    background: #e6f2ff;
    border: 1px solid #0972d3;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #033160;
    font-weight: 600;
}

.cluster-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    padding: 8px 14px;
    border: 1px solid #0972d3;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    background: #0972d3;
    color: white;
    font-family: 'Amazon Ember', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.action-btn:hover:not(:disabled) {
    background: #0762b7;
}

.action-btn:disabled {
    background: #aab7b8;
    border-color: #aab7b8;
    cursor: not-allowed;
}

.action-btn.resolve-btn {
    background: #067f68;
    border-color: #067f68;
}

.action-btn.resolve-btn:hover {
    background: #055d4f;
}
