:root {
    --primary: #2563eb;
    --danger: #dc2626;
    --success: #16a34a;
    --border: #e5e7eb;
    --bg-head: #f9fafb;
    --text: #1f2937;
    --highlight: #e0f2fe; /* Light blue for non-zero values */
}

* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

body { background: #f3f4f6; margin: 0; padding: 20px; display: flex; justify-content: center; }

.container {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 100%;
}

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; border-bottom: 2px solid var(--border); padding-bottom: 16px; }
h1 { margin: 0; font-size: 1.5rem; color: var(--text); }
p { margin: 4px 0 0; color: #6b7280; font-size: 0.9rem; }

.btn-reset {
    background: white; border: 1px solid var(--danger); color: var(--danger);
    padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600;
    transition: all 0.2s;
}
.btn-reset:hover { background: var(--danger); color: white; }

/* Grid System */
.timesheet-grid {
    display: grid;
    /* Label | Mon | Tue | Wed | Thu | Fri | Total */
    grid-template-columns: 200px repeat(5, 1fr) 100px;
    gap: 1px;
    background: var(--border); /* Creates grid lines */
    border: 1px solid var(--border);
}

.header-cell { background: var(--bg-head); padding: 12px; font-weight: 700; text-align: center; color: var(--text); }
.label-col { text-align: left; }
.total-col { background: #eff6ff; font-weight: 700; color: var(--primary); }

.row-label {
    background: white; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between;
    font-size: 0.9rem; font-weight: 500;
}
.sub-label {
    background: #fafafa; color: #6b7280; font-size: 0.8rem; justify-content: flex-end; padding-right: 12px; font-style: italic;
}
.footer-label { background: var(--text); color: white; font-size: 1rem; }

/* Input Cells */
.input-cell { background: white; padding: 6px; display: flex; gap: 4px; justify-content: center; align-items: center; }
input {
    width: 100%; border: 1px solid #d1d5db; border-radius: 4px; padding: 6px; text-align: center; font-size: 0.9rem;
}
input:focus { outline: 2px solid var(--primary); border-color: transparent; }

/* Placeholder text styles for Inputs */
.inp-h::placeholder, .inp-m::placeholder { color: #9ca3af; font-size: 0.8rem; }

/* Read Only Cells */
.read-only-cell {
    background: white; display: flex; align-items: center; justify-content: center;
    font-family: monospace; font-size: 0.95rem; color: #6b7280;
}

/* Specific styling for Decimal Values to make them scannable */
.decimal-display { color: #9ca3af; }
.decimal-display.has-value {
    background-color: var(--highlight);
    color: var(--primary);
    font-weight: 700;
}
.small { font-size: 0.85rem; }

.divider { grid-column: 1 / -1; height: 8px; background: #e5e7eb; }

/* Balance Footer */
.balance-cell {
    background: #f0fdf4; padding: 8px; text-align: center;
    display: flex; flex-direction: column; justify-content: center;
}
.bal-decimal { font-weight: 700; font-size: 1.1rem; color: var(--success); font-family: monospace; }
.bal-time { font-size: 0.75rem; color: #15803d; }

/* Negative Balance State */
.balance-cell.negative { background: #fef2f2; }
.balance-cell.negative .bal-decimal { color: var(--danger); }
.balance-cell.negative .bal-time { color: #991b1b; }

/* Tooltip */
.info-icon {
    background: #e5e7eb; color: #6b7280; border-radius: 50%; width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center; font-size: 0.7rem; cursor: help;
    position: relative;
}
.info-icon:hover::after {
    content: attr(tooltip);
    position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
    background: #1f2937; color: white; padding: 8px 12px; border-radius: 6px;
    width: 250px; font-size: 0.8rem; z-index: 10; margin-left: 10px; line-height: 1.4; pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
