* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    display: flex;
    height: 100vh;
}
.sidebar {
    width: 290px;
    background: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    overflow-y: auto;
}
@media (max-width: 899px) {
    .sidebar {
        display: none;
    }
}
.sidebar-right {
    width: 320px;
    background: white;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
    overflow-y: auto;
}
@media (max-width: 1219px) {
    .sidebar-right {
        display: none;
    }
}
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-header h3 {
    font-size: 16px;
    color: #333;
}
.calendar-nav {
    display: flex;
    gap: 10px;
}
.calendar-nav button {
    background: #f0f0f0;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}
.calendar-nav button:hover {
    background: #e0e0e0;
}
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 15px;
}
.calendar-day-header {
    text-align: center;
    font-size: 11px;
    color: #666;
    padding: 5px;
    font-weight: 600;
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    background: #fafafa;
    transition: all 0.2s;
}
.calendar-day:hover {
    background: #e8e8e8;
}
.calendar-day.has-data {
    background: #4CAF50;
    color: white;
    font-weight: 600;
}
.calendar-day.selected {
    background: #2196F3;
    color: white;
    font-weight: 600;
}
.calendar-day.empty {
    background: transparent;
    cursor: default;
}
.username-bar {
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    min-width: 290px;
}
.username-bar label {
    font-weight: 600;
    color: #555;
    margin-right: 5px;
}
.username-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.username-btn:hover {
    border-color: #4CAF50;
    background: #f1f8f4;
}
.username-btn.selected {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}
.add-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
	max-width: 600px;
}
.add-form-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
    gap: 40px;
    align-items: center;
}
.add-form-header h2 {
    color: #333;
    font-size: 20px;
    margin: 0;
}
.add-form-header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}
.add-form h2 {
    margin-left: 30px;
    color: #333;
    font-size: 20px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}
.form-group textarea {
    resize: vertical;
    min-height: 60px;
}
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary {
    background: #4CAF50;
    color: white;
}
.btn-primary:hover {
    background: #45a049;
}
.btn-danger {
    background: #f44336;
    color: white;
}
.btn-stop {
    background: #ff9800;
    color: white;
	border-radius: 0;
}
.btn-trash {
    background: #757575;
    color: white;
    margin-left: 5px;
}
.btn-trash:hover {
    background: #616161;
}
.btn-trash.trashed {
    background: #d32f2f;
}
.btn-trash.trashed:hover {
    background: #c62828;
}
.btn-recover {
    background: #2196F3;
    color: white;
    margin-left: 5px;
}
.btn-recover:hover {
    background: #1976D2;
}
.task-section {
    margin-bottom: 30px;
}
.task-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}
.task-card {
    background: white;
    padding: 10px;
    padding-bottom: 0px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: opacity 0.3s;
	max-width: 800px;
	min-width: 240px;
}
.task-card.trashed {
    opacity: 0.4;
    background: #fafafa;
}
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
	gap: 15px;
}
.task-description {
    flex: 1;
    min-width: 0;
    position: relative;
    display: inline-block;
}
.task-description-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666;
    font-size: 14px;
    cursor: default;
}
.task-description:hover .tooltip-text {
      visibility: visible;
      opacity: 1;
}
.tooltip-text {
      visibility: hidden;
      opacity: 0;
      background-color: #333;
      color: #fff;
      text-align: center;
      padding: 5px 10px;
      border-radius: 4px;
      position: absolute;
      z-index: 1;
      bottom: 125%;
      transform: translateX(-20%);
      transition: opacity 0.3s ease;
      white-space: nowrap;
}
.task-info h4 {
    color: #333;
    font-size: 16px;
    margin-bottom: 5px;
}
.task-info p {
    color: #666;
    font-size: 13px;
    margin-bottom: 3px;
}
.task-times {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    align-items: center;
	flex-wrap: wrap;
}
.time-edit {
    display: flex;
    align-items: center;
    gap: 0px;
    font-size: 13px;
}
.time-edit input {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 9px;
    width: 150px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
}
.duration {
    background: #e3f2fd;
    padding: 5px 10px;
    border-radius: 4px;
    color: #1976d2;
    font-weight: 600;
}
.running {
    background: #fff3cd;
    color: #856404;
}
.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.recent-header h3 {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}
.recent-item {
    background: #eaeaea;
    padding: 4px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid #4CAF50;
    cursor: pointer;
    transition: all 0.2s;
}
.recent-item:hover {
    background: #f0f0f0;
    transform: translateX(-2px);
}
.recent-item.trashed {
    border-left-color: #d32f2f;
    opacity: 0.6;
}
.recent-item-title {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    margin-bottom: 4px;
}
.recent-item-desc {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}
.recent-item-date {
    font-size: 11px;
    color: #0b6f0f;
}
.recent-item-duration {
    font-size: 11px;
    color: #1976d2;
    font-weight: 600;
    margin-top: 4px;
}

.timeline-bar {
    width: calc(100% + 20px);
    left: -10px;
    height: 8px;
    background: #6f6f6f;
    border-radius: 4px;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

.timeline-fill {
    position: absolute;
    height: 100%;
    background: #43e84a;
    top: 0;
    border: 1px solid #29a02e;
    border-radius: 1px;
}
.timeline-fill-back {
    position: absolute;
    height: 100%;
    background: #86b8e0;
    top: 0;
    border-top: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

.day-summary-card {
    background: white;
    padding: 20px;
    padding-bottom: 0px;
    border-radius: 8px;
    margin-top: 30px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 800px;
}

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

.day-summary-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.day-summary-total {
    font-size: 14px;
    color: #1976d2;
    font-weight: 600;
}

.day-timeline-container {
    position: relative;
    height: 40px;
    background: #6f6f6f;
    border-radius: 6px;
    width: calc(100% + 40px);
    left: -20px;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

.day-timeline-segment {
    position: absolute;
    height: 100%;
    top: 0;
    background: #43e84a;
    border: 1px solid #29a02e;
    border-radius: 1px;
}

.span-holder {
	display: flex;
	gap: 0px;
	margin-left: 0px;
}
.button-black-span {
	background: #000;
	color: white;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	min-width: 50px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    height: 25px;
    align-content: center;
}
.button-gray-span {
	background: #c8c8c8;
	color: #000;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	min-width: 50px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    height: 25px;
    align-content: center;
}
.button-gray2-span {
	background: #c8c8c8;
	color: #000;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	min-width: 50px;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
}
.button-blue-span {
	background: #2196F3;
	color: white;
	padding: 4px 10px;
	border-radius: 0px;
	font-size: 12px;
	font-weight: 500;
    height: 25px;
    align-content: center;
}
.button-green-span {
	background: #4CAF50;
	color: white;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
    height: 25px;
    align-content: center;
}


        .login-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }
        .login-modal.active {
            display: flex;
        }
        .login-box {
            background: white;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            width: 100%;
            max-width: 400px;
        }
        .login-box h2 {
            margin-bottom: 20px;
            color: #333;
        }
        .login-error {
            background: #f44336;
            color: white;
            padding: 10px;
            border-radius: 4px;
            margin-bottom: 15px;
            display: none;
        }
        .login-btn {
            background: #4CAF50;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
        }
        .logout-btn {
            background: #f44336;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
        }

.recent-item-duration.running {
    color: #f57c00;
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    /* Hide all edit/add functionality */
    .add-form,
    .btn:not(.username-btn),
    .time-edit input,
    .task-card button,
    .login-btn,
    .logout-btn {
        display: none !important;
    }

    /* Make time displays always visible (no edit mode) */
    .time-edit {
        pointer-events: none;
    }
}

/* Improve mobile layout */
@media (max-width: 768px) {
	.task-info {
	    display: flex;
	    flex-direction: column;
	    align-items: stretch;
	    width: 100%;
	}
	.task-info .button-black-span {
		border-top-right-radius: 4px !important;
	    border-bottom-right-radius: 0 !important;
	    border-bottom-left-radius: 0 !important;
		width: 100%;
	}
	.task-info .button-gray2-span {
	    border-top-left-radius: 0 !important;
	    border-bottom-left-radius: 4px !important;
		border-top-right-radius: 0 !important;
	    left: 0 !important;
	    top: 0 !important;
		width: 100%;
	}

    .main-content {
        padding: 15px;
    }

    .username-bar {
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .username-bar label {
        width: 100%;
        margin-bottom: 5px;
    }

    .username-btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    /* Stack task info vertically */
    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .task-times {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .time-edit {
        width: 100%;
    }

    .span-holder {
        width: 100%;
        justify-content: left;
    }

    .duration {
        width: 100%;
        text-align: center;
        padding: 8px;
        font-size: 14px;
    }

    /* Make task cards more mobile-friendly */
    .task-card {
        padding: 15px;
        padding-bottom: 0px;
        margin-bottom: 12px;
    }

    .button-gray-span {
	    width: 33%;
	}
    .button-black-span {
	    width: 33%;
	}
    .button-blue-span {
	    width: 65%;
		text-align: center;
	}
    .button-green-span {
	    width: 35%;
		text-align: end;
	}

    /* Make timeline bars thicker and more visible */
    .timeline-bar {
        height: 12px;
        margin-top: 12px;
    }

    .timeline-fill {
        border-width: 2px;
    }

    /* Day summary improvements */
    .day-summary-card {
        padding: 15px;
        padding-bottom: 0;
    }

    .day-timeline-container {
        height: 50px;
    }

    /* Task section headers */
    .task-section h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }

    .task-card {
        padding: 12px;
        padding-bottom: 0px;
		min-width: 290px;
    }

    .button-black-span,
    .button-gray2-span,
    .button-blue-span,
    .button-green-span {
        font-size: 11px;
        padding: 4px 8px;
        min-width: auto;
    }

    .button-gray-span {
        font-size: 11px;
        padding: 4px 8px;
        min-width: auto;
    }
}

/* Fix horizontal scroll on small screens */
@media (max-width: 480px) {
    body {
        overflow-x: hidden;
    }

    .main-content {
        padding: 10px;
        overflow-x: hidden;
    }

    .task-card {
        padding: 12px;
        padding-bottom: 0px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Fix timeline bars that extend beyond container */
    .timeline-bar {
        width: 100%;
        left: 0;
    }

    /* Fix day timeline container */
    .day-timeline-container {
        width: 100%;
        left: 0;
    }

    .day-summary-card {
        padding: 12px;
        padding-bottom: 0;
        max-width: 100%;
    }

    /* Fix username bar */
    .username-bar {
        padding: 10px;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Fix any text that might overflow */
    .task-description-text {
        max-width: 100%;
    }

    .button-black-span,
    .button-gray2-span,
    .button-blue-span,
    .button-green-span,
    .button-gray-span {
        font-size: 11px;
        padding: 4px 8px;
        min-width: 60px;
    }

    /* Fix time display holders */
    .span-holder {
        max-width: 100%;
        flex-wrap: wrap;
    }

    /* Ensure task times don't overflow */
    .task-times {
        max-width: 100%;
    }

    .time-edit {
        max-width: 100%;
    }
}

.username-report {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    height: 46px;
    font-size: 18px;
	display: none;
}
@media (max-width: 768px) {
	.username-report {
		display: block;
	}
}
