
/* Spreadsheet View (Dense) */
.spreadsheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem !important; /* Increased font size for better readability */
    background: white;
}

.spreadsheet-table th,
.spreadsheet-table td {
    padding: 3px 6px;
    border: 1px solid #999 !important;
    text-align: center;
    vertical-align: middle;
    white-space: normal; /* Allow text to wrap */
}

/* Vertical Headers */
.spreadsheet-table th.rotate-header {
    height: 160px; /* Slightly taller to accommodate wraps */
    white-space: normal;
    position: relative;
    padding-bottom: 10px;
    vertical-align: bottom;
}

.spreadsheet-table th.rotate-header > div {
    transform: rotate(180deg); /* Or -90deg depending on writing mode preference */
    writing-mode: vertical-rl;
    white-space: normal; /* Allow vertical wrapping into multiple lines */
    display: inline-block;
    max-height: 100%;
    width: auto; /* Allow width to grow with multiple vertical lines */
    min-width: 20px;
}

/* Specific Column widths */
.spreadsheet-table th:first-child, /* Troop */
.spreadsheet-table td:first-child {
    font-weight: bold;
    width: 50px;
}

.spreadsheet-table th:nth-child(2), /* Name */
.spreadsheet-table td:nth-child(2) {
    text-align: left;
    min-width: 150px;
}

/* Sticky Header specific to spreadsheet */
.spreadsheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #eee;
    box-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.spreadsheet-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
.spreadsheet-table tr:hover {
    background-color: #e8f4fc;
}

/* Admin Input Styling */
.spreadsheet-table input.admin-input {
    width: 60px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
}

.spreadsheet-table input.admin-input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Sortable Headers */
.spreadsheet-table th.sortable-header:hover {
    background-color: #ddd !important;
}
.spreadsheet-table th.sorted {
    background-color: #d1ecf1 !important;
    color: #0c5460;
}

/* Metric field columns — raw measured value (amber) */
.spreadsheet-table th.col-metric,
.spreadsheet-table td.col-metric {
    background-color: #fff3cd !important;
    color: #664d03;
    font-weight: bold;
}

/* Metric-to-points conversion columns — official enters converted pts (green) */
.spreadsheet-table th.col-metric-pts,
.spreadsheet-table td.col-metric-pts {
    background-color: #d1e7dd !important;
    color: #0a3622;
}
