* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #1a1a1a; 
    color: #ffffff; 
    min-height: 100vh; 
    padding: 20px; 
}
.container { max-width: 2070px; margin: 0 auto; }

.header { 
    background-color: rgba(255,255,255,0.05); 
    border-radius: 8px; 
    padding: 15px; 
    margin-bottom: 20px; 
    border: 1px solid rgba(255,255,255,0.1); 
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    flex: 1;
}
.page-wrapper {
    display: flex;
    gap: 30px;
    width: 100%;
}
.left-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 360px); /* Reserve space for sleep targets section + gap */
}

h1 { 
    font-size: 2.2em; 
    color: #ffffff; 
    margin: 0;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.control-label {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
}

select, button {
    padding: 10px 15px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: #2a2a2a;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

select option {
    background: #2a2a2a;
    color: #ffffff;
    padding: 5px;
}

select:hover, button:hover {
    background: #3a3a3a;
    border-color: rgba(255,255,255,0.3);
}

button {
    background: rgba(0, 122, 204, 0.2);
    border-color: rgba(0, 122, 204, 0.4);
}

button:hover {
    background: rgba(0, 122, 204, 0.3);
}

/* Multi-select dropdown styles */
.multiselect {
    position: relative;
    display: inline-block;
    width: 250px;
}

.selectBox {
    position: relative;
    display: block;
    padding: 10px 15px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: #2a2a2a;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    min-height: 40px;
}

.selectBox:after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #999;
}

.checkboxes {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid rgba(255,255,255,0.2);
    border-top: none;
    background: #2a2a2a;
    z-index: 100;
    max-height: 600px;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
}

.checkboxes label {
    display: block;
    padding: 8px 15px;
    cursor: pointer;
    transition: background 0.2s;
    color: #ffffff;
}

.checkboxes label:hover {
    background: rgba(255,255,255,0.1);
}

.checkboxes input[type="checkbox"] {
    margin-right: 10px;
}

/* Make ellipsis inherit text color */
td span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.main-content {
    background-color: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.grid-container {
    overflow: auto;
    height: calc(100vh - 288px);
    min-height: 300px;
}

/* Hide scrollbar for miners table */
.grid-container::-webkit-scrollbar {
    display: none;
}

.grid-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    table-layout: fixed;
}

th {
    background-color: #2a2a2a;
    color: #ffffff;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

tr:hover {
    background-color: rgba(255,255,255,0.02);
}

tr:nth-child(even) {
    background-color: rgba(255,255,255,0.01);
}

tbody tr {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Hide table borders when tbody is loading */
#minerTableBody.loading td {
    border-bottom: none !important;
    background-color: transparent !important;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-good { background-color: #48bb78; }
.status-warning { background-color: #ed8936; }
.status-error { background-color: #e53e3e; }

/* Sleep target management styles */
.sleep-targets-section { 
    width: 300px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Hide scrollbar for sleep targets */
.sleep-targets-section::-webkit-scrollbar {
    display: none;
}

.sleep-targets-section {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.sleep-targets-section h2 {
    margin: 0 0 20px 0;
    color: #ffffff;
    font-size: 1.3em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}
.sleep-target-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}
.sleep-target-row:hover {
    background-color: rgba(255,255,255,0.05);
}
.pod-name {
    font-size: 0.9rem;
    color: #ccc;
}
.sleep-target-input {
    width: 70px;
    padding: 5px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: #2a2a2a;
    color: #ffffff;
    font-size: 0.9rem;
    text-align: center;
}
.sleep-target-input:focus {
    outline: none;
    border-color: rgba(72, 187, 120, 0.6);
}

/* Hide number input spinner arrows */
.sleep-target-input::-webkit-outer-spin-button,
.sleep-target-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sleep-target-input[type=number] {
    -moz-appearance: textfield;
}

/* Capacity section styles */
.capacity-section {
    margin-bottom: 15px;
}

.capacity-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.capacity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.02);
    transition: background-color 0.2s;
}

.capacity-row:hover {
    background-color: rgba(255,255,255,0.05);
}

.capacity-row .pod-name {
    font-size: 0.85rem;
    color: #ccc;
}

.capacity-row .sleeping-count {
    font-weight: bold;
    font-size: 0.9rem;
}

.capacity-row .miner-capacity {
    font-size: 0.8rem;
}